@jsy-lang/jsy (formerly jsy-transpile)

raw JSON →
0.10.9 verified Fri May 01 auth: no javascript

JSY is an offside-rule (indentation-based) syntax dialect for ECMAScript that transpiles to standard JavaScript via a scanner-pass transformation, without Babel, Acorn, or any runtime dependencies. Current stable version 0.10.9. It supports modern JavaScript up to ES2025, has zero dependencies, 6300+ unit tests, and works with Rollup, ESBuild, Parcel, Vite, and Node.js --loader. Unlike CoffeeScript or Python-inspired alternatives, JSY automatically keeps pace with new ECMAScript features because its transformation only handles indentation and comments, leaving the underlying JavaScript syntax untouched. The package was renamed from jsy-transpile to @jsy-lang/jsy.

error Error: Cannot find module 'jsy-transpile'
cause Package renamed from jsy-transpile to @jsy-lang/jsy.
fix
Install @jsy-lang/jsy and update imports: 'npm install @jsy-lang/jsy' then 'import jsy from "@jsy-lang/jsy"'.
error TypeError: jsy(...) is not a function
cause Attempting to use a named import { transpile } instead of default import.
fix
Use default import: 'import jsy from "@jsy-lang/jsy"'.
error Parsing error: Unexpected token (1:1) after transpiling
cause Incorrectly structured JSY code, e.g., missing indentation or wrong syntax.
fix
Verify that all blocks are properly indented. JSY uses indentation to denote blocks. Use spaces consistently.
error ReferenceError: module is not defined
cause Using CommonJS require in an ES module context.
fix
Use ES imports instead: 'import jsy from "@jsy-lang/jsy"'.
breaking Package renamed from jsy-transpile to @jsy-lang/jsy. All imports using the old package name will break.
fix Replace 'jsy-transpile' with '@jsy-lang/jsy' in package.json and all imports.
deprecated The old package 'jsy-transpile' on npm is no longer maintained. Use '@jsy-lang/jsy' instead.
fix Run 'npm install @jsy-lang/jsy' and update imports.
gotcha The default export is the transpile function, not an object. Do not destructure { transpile }.
fix Use 'import jsy from "@jsy-lang/jsy"' and call jsy(source, options).
gotcha JSY transformation is syntactical only; it does not transform JavaScript semantics. Some constructs (e.g., async/await inside indented blocks) require correct indentation to work.
fix Ensure indentation is consistent (tabs or spaces, not mixed). Use 2 or 4 spaces per level.
breaking Options for transpile function have changed between pre-0.10 and 0.10+. The 'module' option now defaults to false.
fix Explicitly set 'module: true' if you want ES module output.
npm install jsy-transpile
yarn add jsy-transpile
pnpm add jsy-transpile

Transpiles a simple JSY function with indentation-based syntax into standard JavaScript.

import jsy from '@jsy-lang/jsy';

const jsyCode = `
  add = (a, b) ->
    a + b

  console.log add(1, 2)
`;

const jsCode = jsy(jsyCode, {
  module: true,
  sourceType: 'module',
});

console.log(jsCode);
// Output:
// const add = (a, b) => {
//   return a + b
// }
// console.log(add(1, 2))