Registry / devops / ct-core

ct-core

JSON →
library1.9.72jsnpmunverified

CT-CORE (v1.9.72) is a Node.js framework for building REST APIs defined via JSON metadata, reducing boilerplate by enabling API, module, and version definitions in configuration files. It integrates with MongoDB, MySQL/MariaDB, and SQL Server using drivers like Mongoose, mariadb, and mssql. Released on npm with updates as needed, it includes CLI tools for project initialization and generation of API documentation via apidoc. Differentiators include a metadata-driven approach versus code-first frameworks like Express.

npm install ct-core
INSTALL
IMPORT
SIG · CT-CORE
C
ct-core
devopsjavascriptv1.9.72
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.

ct-core
const core = require('ct-core');
import core from 'ct-core';
CommonJS only; no ESM support.
core function
const core = require('ct-core'); core('start');
ct-core.start();
The default export is a function that accepts a command string.

Creates a minimal index.js file that imports CT-CORE and starts the server or runs a command based on environment variable.

// index.js const core = require('ct-core'); const cmd = process.env.START_WITH || 'start'; try { core(cmd); } catch (e) { console.error(e); }
Debug
Known issues
gotchaThe default export of 'ct-core' is a function, not an object with methods. Calling core.start() will throw an error.
fix
core('start') instead of core.start()
affects: >=1.0.0
gotchaRequires MongoDB 4.4+ if using MongoDB driver; older versions will fail to connect.
fix
Upgrade MongoDB to 4.4 or later.
affects: >=1.0.0
gotchaThe package is CommonJS only; attempting to use ES modules (import) will result in a runtime error.
fix
Use require() instead of import.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: core is not a function
Calling core as an object with a method like core.start()
fix
Call core('start') instead of core.start().
MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined". Make sure the first parameter to `mongoose.connect()` or `mongoose.createConnection()` is a string.
MongoDB connection string not configured; missing environment variables.
fix
Create .env file from .env.copy and set MONGO_DB_HOST, MONGO_DB_PORT, etc.
Error: Cannot find module 'ct-core'
Package not installed, or installed globally without using global require path.
fix
Run 'npm install -g ct-core' or 'npm install ct-core' in the project directory.
Upgrade
Version history
1.9.72latest on npm
Audit
Dependencies
mongooseoptionalMongoDB driver integration
mariadboptionalMariaDB/MySQL driver integration
mssqloptionalSQL Server driver integration
apidocoptionalAPI documentation generation
cross-envoptionalCross-platform environment variable setting
Agent activity
8 hits · last 30 days
node
8
Resources
ct-core — npm install ct-core · libregistry