@spanexx/sdk-node-cjs
v0.0.1
Published
CommonJS build of @spanexx/sdk-node — for CJS consumers (nest, most node apps). Source is mirrored from @spanexx/sdk-node; updated in lockstep.
Maintainers
Readme
@spanexx/sdk-node-cjs
CommonJS build of @spanexx/sdk-node for CJS consumers.
Why this exists
@spanexx/sdk-node is ESM-only. CJS consumers (NestJS, Express, plain Node) cannot require() it.
This package ships the same source compiled to CJS. Source is mirrored from @spanexx/sdk-node/src/ at build time.
Install
npm install @spanexx/sdk-node-cjs
# Pulls in @spanexx/event-bus-cjs automaticallyUsage
// CJS — works in NestJS, etc.
const { createSdk } = require('@spanexx/sdk-node-cjs');
const sdk = createSdk({
gateway: { url: 'ws://localhost:7300', token: '...' },
app: { id: 'my-app', name: 'My App' },
manifest: { /* ... */ },
handlers: {
'product.list': async (input) => ({ items: [] }),
},
});
await sdk.connect();
await sdk.register();For ESM consumers, use the original @spanexx/sdk-node.
License
MIT
