This package now ships dual builds for CommonJS and ES Modules.
Outputs:
- CJS:
dist/cjs(Noderequire()) - ESM:
dist/esm(Nodeimport)
Package entry points are configured via the exports map:
import { SDK } from '@nebius/js-sdk'->dist/esm/index.jsconst { SDK } = require('@nebius/js-sdk')->dist/cjs/index.js
Usage examples:
// ESM
import { SDK } from '@nebius/js-sdk';// CJS
const { SDK } = require('@nebius/js-sdk');Build & publish:
- Ensure codegen is reproducible (requires buf and protoc set up if you regenerate APIs):
npm run generate
- Build the package:
npm run build
- Run tests:
npm test
- Publish:
npm publish --access public
Notes:
prepublishOnlyrunsnpm run buildautomatically duringnpm publish.- The build writes
package.jsonmarkers intodist/esmanddist/cjsto make Node resolution robust.