Registry / devops / nscale-compiler

nscale-compiler

JSON →
library0.17.0jsnpmunverified

nscale-compiler is a deployment compiler for nearForm's nscale system, used to compile system definitions into deployable artifacts. Version 0.17.0 is the latest stable release. The package has no active release cadence, appearing to be in maintenance mode. It converts nscale container/service definitions into a normalized format for deployment. Key differentiator: part of the nscale toolchain, not widely used outside that ecosystem. Minimal dependencies; primarily uses async and lodash.

npm install nscale-compiler
INSTALL
IMPORT
SIG · NSCALE-COMPILER
N
nscale-compiler
devopsjavascriptv0.17.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.

compile
const compile = require('nscale-compiler').compile;
import { compile } from 'nscale-compiler';
This package uses CommonJS; no ES module support. Default export or named 'compile' from require.
default
const compiler = require('nscale-compiler');
import compiler from 'nscale-compiler';
CommonJS require returns the module.exports object; no default export in ESM syntax.
compileSystem
const compileSystem = require('nscale-compiler').compileSystem;
const { compileSystem } = require('nscale-compiler');
Destructuring works, but note the function is 'compileSystem' not 'compile'; ensure correct name.

Compiles a simple nscale system definition with one container and logs the result.

const compiler = require('nscale-compiler'); const systemDefinition = { containers: { web: { image: 'node:14', ports: ['80:80'] } }, services: {} }; compiler.compile(systemDefinition, function(err, result) { if (err) { console.error('Compilation failed:', err); } else { console.log('Compiled result:', JSON.stringify(result, null, 2)); } });
Debug
Known issues
deprecatedThe nscale project is no longer actively developed; this package is in maintenance mode.
fix
Consider migrating to a more modern deployment tool like Docker Compose or Kubernetes.
affects: >=0.0.0
gotchaThe compiler expects system definitions in a specific format; malformed input may cause cryptic errors.
fix
Validate your system definition against the nscale schema before compilation.
affects: >=0.0.0
breakingVersion 0.14.0 changed the output format of compiled artifacts, breaking consumers expecting the old shape.
fix
Update your code to handle the new output structure; see changelog.
affects: >=0.14.0
gotchaAsynchronous callbacks are used; forgetting to handle the error argument can lead to silent failures.
fix
Always check the error parameter in the callback; consider wrapping with try-catch or using promisify.
affects: >=0.0.0
deprecatedlodash methods used internally may be deprecated in newer versions of lodash.
fix
Pin lodash to a compatible version (e.g., 4.17.x) if you experience issues.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: compiler.compile is not a function
Incorrect require path or import method; using ES modules with this CJS-only package.
fix
Use require('nscale-compiler').compile or const compiler = require('nscale-compiler'); compiler.compile(...)
Error: Invalid system definition: missing 'containers' property
The system definition object lacks required fields.
fix
Ensure the system definition includes a 'containers' object (and optionally 'services').
Callback must be a function
compile() called without a callback function as second argument.
fix
Pass a function as the second argument: compile(def, (err, result) => {...})
Cannot find module 'nscale-compiler'
Package not installed or not in node_modules.
fix
Run 'npm install nscale-compiler' in your project directory.
Upgrade
Version history
0.17.0latest on npm
Audit
Dependencies
asyncrequiredused for asynchronous control flow
lodashrequiredutility library for object manipulation
Agent activity
2 hits · last 30 days
node
2
Resources
nscale-compiler — npm install nscale-compiler · libregistry