{"id":26021,"library":"nscale-compiler","title":"nscale-compiler","description":"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.","status":"maintenance","version":"0.17.0","language":"javascript","source_language":"en","source_url":"https://github.com/nearform/nscale-compiler","tags":["javascript","nearForm","deployer","nscale","compiler","system","definition"],"install":[{"cmd":"npm install nscale-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add nscale-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add nscale-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used for asynchronous control flow","package":"async","optional":false},{"reason":"utility library for object manipulation","package":"lodash","optional":false}],"imports":[{"note":"This package uses CommonJS; no ES module support. Default export or named 'compile' from require.","wrong":"import { compile } from 'nscale-compiler';","symbol":"compile","correct":"const compile = require('nscale-compiler').compile;"},{"note":"CommonJS require returns the module.exports object; no default export in ESM syntax.","wrong":"import compiler from 'nscale-compiler';","symbol":"default","correct":"const compiler = require('nscale-compiler');"},{"note":"Destructuring works, but note the function is 'compileSystem' not 'compile'; ensure correct name.","wrong":"const { compileSystem } = require('nscale-compiler');","symbol":"compileSystem","correct":"const compileSystem = require('nscale-compiler').compileSystem;"}],"quickstart":{"code":"const compiler = require('nscale-compiler');\nconst systemDefinition = {\n  containers: {\n    web: {\n      image: 'node:14',\n      ports: ['80:80']\n    }\n  },\n  services: {}\n};\n\ncompiler.compile(systemDefinition, function(err, result) {\n  if (err) {\n    console.error('Compilation failed:', err);\n  } else {\n    console.log('Compiled result:', JSON.stringify(result, null, 2));\n  }\n});","lang":"javascript","description":"Compiles a simple nscale system definition with one container and logs the result."},"warnings":[{"fix":"Consider migrating to a more modern deployment tool like Docker Compose or Kubernetes.","message":"The nscale project is no longer actively developed; this package is in maintenance mode.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Validate your system definition against the nscale schema before compilation.","message":"The compiler expects system definitions in a specific format; malformed input may cause cryptic errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Update your code to handle the new output structure; see changelog.","message":"Version 0.14.0 changed the output format of compiled artifacts, breaking consumers expecting the old shape.","severity":"breaking","affected_versions":">=0.14.0"},{"fix":"Always check the error parameter in the callback; consider wrapping with try-catch or using promisify.","message":"Asynchronous callbacks are used; forgetting to handle the error argument can lead to silent failures.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin lodash to a compatible version (e.g., 4.17.x) if you experience issues.","message":"lodash methods used internally may be deprecated in newer versions of lodash.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use require('nscale-compiler').compile or const compiler = require('nscale-compiler'); compiler.compile(...)","cause":"Incorrect require path or import method; using ES modules with this CJS-only package.","error":"TypeError: compiler.compile is not a function"},{"fix":"Ensure the system definition includes a 'containers' object (and optionally 'services').","cause":"The system definition object lacks required fields.","error":"Error: Invalid system definition: missing 'containers' property"},{"fix":"Pass a function as the second argument: compile(def, (err, result) => {...})","cause":"compile() called without a callback function as second argument.","error":"Callback must be a function"},{"fix":"Run 'npm install nscale-compiler' in your project directory.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'nscale-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}