Registry / devops / xcraft-core-server

xcraft-core-server

JSON →
library6.5.0jsnpmunverified

The central server module of the Xcraft framework. As of v6.5.0, it orchestrates startup, automatic module discovery, and lifecycle management for the entire Xcraft ecosystem. Release cadence is monthly. Key differentiators include automatic scanning of node_modules for compatible Xcraft modules, recursive dependency resolution, and dual daemon/library execution modes with built-in heartbeat and transport routing. It integrates tightly with xcraft-core-bus, xcraft-core-busclient, and goblin-* actor modules.

npm install xcraft-core-server
INSTALL
IMPORT
SIG · XCRAFT-CORE-SERVER
X
xcraft-core-server
devopsjavascriptv6.5.0
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.

default
const xServer = require('xcraft-core-server');
import xServer from 'xcraft-core-server';
CommonJS only; no ESM export.
runAsDaemon
xServer.runAsDaemon({logs: true, response: (err) => {}});
xServer.runAsDaemon();
Options object is optional but recommended for logging and error handling.
runAsLib
const lib = xServer.runAsLib(); lib.start(callback);
xServer.runAsLib().start();
The library mode requires a callback to handle errors.

Shows how to start the Xcraft server in both daemon and library modes with error handling.

const xServer = require('xcraft-core-server'); // Start as daemon xServer.runAsDaemon({ logs: true, response: (err) => { if (err) { console.error('Startup error:', err); } else { console.log('Server started'); } }, }); // Or as library const lib = xServer.runAsLib(); lib.start((err) => { if (err) { console.error('Library start error:', err); } else { console.log('Library server started'); } });
Debug
Known issues
gotchaModule discovery scans node_modules recursively which can be slow in large projects.
fix
Use the blacklist or filter configuration to exclude irrelevant modules.
affects: <=6.5.0
deprecatedThe `runAsDaemon` without options object still works but may be deprecated in future releases.
fix
Always pass an options object with at least `logs` and `response`.
affects: >=5.0.0
gotchaRunning as library without calling `start()` will leave the server in an uninitialized state.
fix
Always call `lib.start(callback)` after creating the library instance.
affects: all
breakingIn v6.0.0, the `runAsDaemon` signature changed from callback-only to options object.
fix
Update calls to pass `{logs: true, response: callback}` instead of just a function.
affects: >=6.0.0
Errors
Common errors & fixes
Error: Cannot find module '../lib/boot'
Incorrect require path due to monorepo symlink issues.
fix
Use `require('xcraft-core-server')` instead of relative path.
TypeError: xServer.runAsLib is not a function
Using an older version that only exports daemon mode.
fix
Update to v5.0.0 or later, or use `require('xcraft-core-server').runAsLib`.
Timeout waiting for module discovery to complete
Too many modules in node_modules causing slow scan.
fix
Configure a blacklist in options or use environment variable XCRAFT_MODULE_BLACKLIST.
Upgrade
Version history
6.5.0latest on npm
Audit
Dependencies
xcraft-core-busrequiredcore communication bus used by all modules
xcraft-core-busclientrequiredclient connection to the bus
xcraft-core-etcoptionalmodule configuration loading
xcraft-core-transportoptionalmessage transport and routing
xcraft-core-hordeoptionalautomatic integration if hordes configured
Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
xcraft-core-server — npm install xcraft-core-server · libregistry