Ye Olde Script
raw JSON → 2.3.0 verified Fri May 01 auth: no javascript
Ye Olde Script (v2.3.0) is a transpiler and VS Code extension that translates JavaScript/TypeScript/TSX into 17th-century English keywords and syntax. Intended for fun and novelty, it compiles `.yeolde`, `.parchment`, `.scrollx` files into standard JS/TS/TSX, preserving all semantics. Release cadence is irregular; last major update added TypeScript support. Differentiators: full keyword mapping (Incantation→function, useCrystalBall→useState), support for React/Next.js directives (`'this parchment doth run on the client'`), and built-in syntax highlighting in VS Code. Not recommended for production or serious projects.
Common errors
error SyntaxError: Cannot use import statement outside a module ↓
cause Package is ESM-only since v2.0, but project is configured for CommonJS.
fix
Add "type": "module" to package.json, or use dynamic import().
error Error: Unknown file extension .yeold ↓
cause Misspelled file extension; valid extensions are .yeolde, .ye, .parchment, .scrollx, .illuminated.
fix
Use correct extension:
.yeolde not .yeold. error TypeError: yeoldescript is not a function ↓
cause Default import was used but v2.0 removed default export.
fix
Use
import { compile } from 'yeoldescript' instead of import yeo from 'yeoldescript'. error Error: Requires VS Code ^1.60.0 ↓
cause Installing VS Code extension on an older version.
fix
Update VS Code to v1.60.0 or later.
Warnings
breaking v2.0 changed to ESM-only. require() will throw. ↓
fix Use import syntax or downgrade to v1.x if CommonJS required.
deprecated Default import deprecated in v2.0; use named imports. ↓
fix Use `import { compile } from 'yeoldescript'` instead of `import yeo from 'yeoldescript'`.
gotcha VS Code extension requires VS Code >=1.60.0. ↓
fix Update VS Code to v1.60.0 or later.
gotcha File extension .yeolde compiles to .js, .parchment to .ts, .scrollx/.illuminated to .tsx. Misusing extensions may produce incorrect output type. ↓
fix Match extension to intended output language.
gotcha Node.js >=18 required due to use of modern JavaScript features. ↓
fix Upgrade Node.js to v18 or later.
Install
npm install yeoldescript yarn add yeoldescript pnpm add yeoldescript Imports
- yeoldescript wrong
const yeoldescript = require('yeoldescript')correctimport { compile } from 'yeoldescript' - compile wrong
import compile from 'yeoldescript'correctimport { compile } from 'yeoldescript' - run wrong
import { run } from 'yeoldescript'correctimport { run } from 'yeoldescript'
Quickstart
import { compile } from 'yeoldescript';
const code = `Decree greeting = "Huzzah!"; TownCrier.bellow(greeting);`;
const out = compile(code, { sourceType: 'script' });
console.log(out); // "const greeting = \"Huzzah!\"; console.log(greeting);"