JavaScwipt
raw JSON →JavaScwipt is an esoteric, UwU-ified version of JavaScript that replaces standard keywords with cutesy alternatives (e.g., `var` → `vawar`, `let` → `nya`, `const` → `fowever`, `function` → `fuwunction`, `return` → `bacc`, `class` → `cwass`). It uses acornjs and escodegen to transpile `.jscwipt` source files into plain JavaScript (`.js` or `.mjs`). The npm package provides both a library API and the `jswc` CLI tool. Version 1.0.10 is the current stable release; the project is maintained as a novelty/educational tool. Unlike standard JavaScript, JavaScwipt forces the use of replaced keywords and reserves original JS keywords, meaning you must write `nya x = 1` instead of `let x = 1`. The tool is not meant for production use but for fun, learning transpiler internals, or novelty code.
Common errors
error Error: Cannot find module './src/...' or "No .jscwipt files found" ↓
error SyntaxError: Unexpected token (1:4) ↓
error TypeError: (intermediate value) is not a function ↓
import { compile } from 'javascwipt'; compile(...) error ReferenceError: fowever is not defined ↓
error SyntaxError: Unexpected token '.' (maybe caused by acorn version mismatch?) ↓
Warnings
breaking Original JavaScript keywords (let, const, var, function, etc.) are treated as syntax errors inside .jscwipt files. ↓
gotcha .jscwipt files must be placed in a directory named 'src' relative to where you run the jswc command; otherwise compilation fails with a file-not-found error. ↓
gotcha The CLI's default output is a .js file (CommonJS). To run with modern Node.js (ESM), you must use 'jswc mjs' to produce a .mjs file. ↓
deprecated No versions have been deprecated, but the project is a novelty tool; breaking changes may occur without notice if underlying dependencies (acorn, escodegen) update. ↓
gotcha The library's named exports may not include a default export; attempting import javascwipt from 'javascwipt' will result in undefined. ↓
Install
npm install javascwipt yarn add javascwipt pnpm add javascwipt Imports
- compile wrong
const javascwipt = require('javascwipt'); javascwipt.compile('nya x = 1')correctimport { compile } from 'javascwipt' - compileFile
import { compileFile } from 'javascwipt' - jswc CLI wrong
jswc compilecorrectinstall globally (npm install -g javascwipt) then run: jswc [mode]
Quickstart
// Install globally: npm install -g javascwipt
// Create src/test.jscwipt with:
/*
nya x = 'Hello World!';
console.log(x);
*/
// Run in terminal:
// jswc → produces src/test.js
// jswc mjs → produces src/test.mjs
// node src/test.mjs
// Output: Hello World!
// Programmatic usage:
// import { compile } from 'javascwipt';
// const compiled = compile("nya x = 1; bacc x * 2;");
// console.log(compiled); // 'let x = 1; return x * 2;'