Jsjs
raw JSON → 0.1.7 verified Fri May 01 auth: no javascript
Jsjs is a JavaScript dialectic transpiler that converts alternative JavaScript-like syntaxes into standard JavaScript. Version 0.1.7 is the latest stable release, though the project appears to be in an early stage with minimal features and low release cadence. It supports dialects such as 'js' (standard ECMAScript 5) and 'gs' (Go-inspired syntax without types). It can be used as a command-line tool or programmatically via Node.js require extensions. Differentiators include its focus on alternative syntax transpilation and Node require hook support, but it lacks active development and documentation.
Common errors
error SyntaxError: Unexpected identifier ↓
cause Input code in unsupported dialect without specifying dialect option.
fix
Add dialect option matching the input syntax.
error TypeError: jsjs.transpile is not a function ↓
cause Likely using ESM import syntax; package is CJS-only.
fix
Switch to require('jsjs').
error Error: No dialect provided ↓
cause Missing dialect option in transpile call.
fix
Provide a valid dialect object from jsjs.dialects.
Warnings
gotcha Package has very limited documentation and no clear API stability. Use at your own risk. ↓
fix Review source code or consider alternative tools.
gotcha Only supports Node.js CommonJS modules. No ESM or browser support. ↓
fix Use require() instead of import.
gotcha The package is not actively maintained. Last update likely old. ↓
fix Check GitHub for recent activity before relying on it.
gotcha CLI tool may have limited features and no error handling. ↓
fix Test with small inputs first.
Install
npm install node-jsjs yarn add node-jsjs pnpm add node-jsjs Imports
- jsjs wrong
import jsjs from 'jsjs';correctconst jsjs = require('jsjs'); - register wrong
import { register } from 'jsjs';correctconst { register } = require('jsjs'); - dialects wrong
const dialects = require('jsjs').dialects;correctconst { dialects } = require('jsjs');
Quickstart
const jsjs = require('jsjs');
const gsDialect = jsjs.dialects.gs;
const code = `
func pow(a, b) {
for r := a, n := 0; n < b; n++ {
r = r * a
}
return r
}
`;
const result = jsjs.transpile(code, { dialect: gsDialect });
console.log(result);