Registry / serialization / jsdc
library0.6.13jsnpmunverified

jsdc is a JavaScript transpiler that converts ES6/ES2015 code to ES5 for backward compatibility. Current stable version is 0.6.13, last released in 2017. It focuses on safe transformations preserving line numbers for debugging, supports CommonJS/AMD/CMD, and includes features like let/const, arrow functions, classes, generators, destructuring, template literals, and modules. Unlike Babel or Traceur, jsdc is lightweight, has no runtime dependencies, and aims for simplicity. The project appears to be in maintenance mode with no recent updates.

npm install jsdc
INSTALL
IMPORT
SIG · JSDC
J
jsdc
serializationjavascriptv0.6.13
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.

Jsdc
import Jsdc from 'jsdc'
const Jsdc = require('jsdc')
ESM import is preferred; CJS require works but requires default import handling.
parse (static method)
import Jsdc from 'jsdc'; const result = Jsdc.parse(code)
const parse = require('jsdc').parse
Static method 'parse' is available directly on the imported class.
runtime
import Jsdc from 'jsdc'; Jsdc.runtime(true)
const runtime = require('jsdc').runtime
Only available in Node.js; enables precompilation via require hook.

Shows basic usage: transpile ES6 code (arrow function, template literal) to ES5 using jsdc.

import Jsdc from 'jsdc'; const es6Code = ` const greet = (name) => { console.log(`Hello, ${name}!`); }; `; const es5Code = Jsdc.parse(es6Code); console.log(es5Code); // Output: var greet = function(name) { // console.log('Hello, ' + name + '!'); // };
jsdc --version
Debug
Known issues
gotchajsdc does NOT provide polyfills for ES6 built-ins like Set, Map, or Promise. You must include your own polyfill library (e.g., es6-shim) if your code depends on them.
fix
Add a polyfill such as `import 'es6-shim'` before using Set/Map/Promise.
affects: >=0.3.0
gotchaThe `runtime(flag)` method modifies Node.js's require mechanism globally, which can cause unexpected behavior in larger projects or when combined with other transpilers.
fix
Avoid using runtime in production; instead, transpile files ahead of time.
affects: >=0.3.0
deprecatedThis package is no longer actively maintained. The last release was in 2017. For new projects, consider using Babel or SWC.
fix
Migrate to Babel: `npm install @babel/core @babel/preset-env`
affects: >=0.0.0
gotchajsdc uses `Object.defineProperty` for some transformations, which may not be fully supported in older JavaScript engines (IE < 9).
fix
Ensure your target environment supports Object.defineProperty or use a polyfill.
affects: >=0.3.0
Errors
Common errors & fixes
Cannot find module 'homunculus'
jsdc depends on the `homunculus` parser, which may not be installed automatically in all environments.
fix
Run `npm install homunculus` alongside jsdc to install the dependency.
TypeError: Jsdc is not a constructor
Using `require('jsdc')` returns an object with a default export, not the constructor directly.
fix
Use `const Jsdc = require('jsdc').default` or switch to ES6 import syntax.
Error: Cannot find module 'jsdc'
jsdc is not installed or is not in the project's node_modules.
fix
Run `npm install jsdc --save-dev` to install it as a dev dependency.
ReferenceError: regeneratorRuntime is not defined
jsdc transpiles generators to regenerator runtime, which must be included separately.
fix
Add `import 'regenerator-runtime/runtime'` before using any generator code.
Unexpected token '=>' (or similar ES6 syntax)
jsdc is not being called on the code; the code is running directly in an environment that doesn't support ES6.
fix
Ensure jsdc.parse() is executed before running the code in an ES5-only environment.
Upgrade
Version history
0.6.13latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jsdc — npm install jsdc · libregistry