Registry / database / xkmob-common

xkmob-common

JSON →
library1.0.192jsnpmunverified

Utility tool for MySQL, Redis, and configuration management, designed to port JEECGBOOT functionality to Node.js. Current stable version is 1.0.192, with frequent releases. Provides helper utilities for database operations, caching, and config handling, primarily targeting Node.js environments. It is part of the XKMob ecosystem, relying on companion packages like xkmob-helper for extended functionality. Minimal documentation and experimental nature may lead to instability.

npm install xkmob-common
INSTALL
IMPORT
SIG · XKMOB-COMMON
X
xkmob-common
databasejavascriptv1.0.192
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

* as xkmobCommon
import * as xkmobCommon from 'xkmob-common'
const xkmobCommon = require('xkmob-common')
Package ships TypeScript types; ESM import is preferred. CommonJS require may still work but types may not be inferred.
default export
import xkmobCommon from 'xkmob-common'
If the package has a default export, this works. Otherwise use namespace import.
specific named exports (e.g., connectMysql, connectRedis)
import { connectMysql, connectRedis } from 'xkmob-common'
import { connectMysql } from 'xkmob-common/src/connectMysql'
Named exports likely available but not explicitly documented. Avoid deep imports as they may break.
TypeScript types
import type { Config } from 'xkmob-common'
Use import type for type-only imports to avoid bundling runtime code.

Initializes config, MySQL connection, and Redis connection using environment variables. Demonstrates basic usage of the library's three main capabilities.

import * as xkmobCommon from 'xkmob-common'; // Initialize config (example) const config = xkmobCommon.getConfig({ path: './config.json' }); // Connect to MySQL (example) const mysqlConn = xkmobCommon.connectMysql({ host: process.env.MYSQL_HOST ?? 'localhost', user: process.env.MYSQL_USER ?? 'root', password: process.env.MYSQL_PASSWORD ?? '', database: process.env.MYSQL_DATABASE ?? 'test' }); // Connect to Redis (example) const redisClient = xkmobCommon.connectRedis({ host: process.env.REDIS_HOST ?? 'localhost', port: process.env.REDIS_PORT ? Number(process.env.REDIS_PORT) : 6379 }); // Example: set and get from redis await redisClient.set('key', 'value'); const value = await redisClient.get('key'); console.log('Redis value:', value);
Debug
Known issues
gotchaPackage version 1.0.192 is very early; API is highly experimental and may change without notice.
fix
Pin to exact version and test thoroughly before upgrades.
affects: <2.0.0
gotchaPackage relies on xkmob-helper as a dependency; ensure it is installed or available.
fix
Install with: npm install xkmob-common xkmob-helper
affects: *
gotchaDocumentation is minimal; actual API may differ from examples. Functions like connectMysql and connectRedis are assumed.
fix
Inspect package source or type definitions to understand exact exports.
affects: *
Errors
Common errors & fixes
Cannot find module 'xkmob-common'
Package not installed or not in node_modules.
fix
Run: npm install xkmob-common
TypeError: xkmobCommon.connectMysql is not a function
The function may not exist or named differently.
fix
Check package exports: import * as xkmobCommon from 'xkmob-common'; console.log(Object.keys(xkmobCommon));
Module not found: Can't resolve 'xkmob-helper'
peer dependency xkmob-helper not installed.
fix
Install xkmob-helper: npm install xkmob-helper
Upgrade
Version history
1.0.192latest on npm
Audit
Dependencies
xkmob-helperrequiredCore companion package providing additional helper utilities; likely required for full functionality.
mysqloptionalMySQL database driver assumed for database operations.
redisoptionalRedis client assumed for caching operations.
Agent activity
22 hits · last 30 days
node
18
Meta
2
OpenAI (training)
1
Resources
xkmob-common — npm install xkmob-common · libregistry