jinx-compiler
raw JSON → 2.1.2 verified Fri May 01 auth: no javascript deprecated
Node.js module that compiles .jinx files into ActionScript 3 (.as) for use with Adobe Flash SWF/SWC. Current stable version is 2.1.2. Release cadence is irregular; last update was in 2016. Key differentiator: it is a specialized compiler for the .jinx language, which is a higher-level syntax for Flash development. No alternatives exist specifically for .jinx compilation.
Common errors
error TypeError: jinxCompiler is not a function ↓
cause Trying to call require('jinx-compiler') as a function but it's a default export in CommonJS.
fix
Use const jinxCompiler = require('jinx-compiler').default; or switch to ESM import.
error Module not found: Can't resolve 'jinx-compiler' ↓
cause Package not installed or missing dependencies if using bundler.
fix
Run npm install jinx-compiler --save
Warnings
deprecated Package is deprecated; Flash/Adobe technologies are discontinued. ↓
fix Migrate to modern web technologies (HTML5, WebGL) or use alternative frameworks.
breaking Major version 2.0.0 changed the API from synchronous to asynchronous? Verify. ↓
fix Check documentation for version 2.0.0 breaking changes.
gotcha Package does not ship TypeScript definitions. Types must be created manually. ↓
fix Create a declaration file: declare module 'jinx-compiler' { export default function(content: string): string; }
Install
npm install jinx-compiler yarn add jinx-compiler pnpm add jinx-compiler Imports
- default wrong
const jinxCompiler = require('jinx-compiler')correctimport jinxCompiler from 'jinx-compiler' - jinxCompiler wrong
import { jinxCompiler } from 'jinx-compiler'correctimport jinx from 'jinx-compiler' - compile (default) wrong
const compile = require('jinx-compiler').defaultcorrectimport compile from 'jinx-compiler'
Quickstart
import fs from 'fs';
import compile from 'jinx-compiler';
const jinxContent = fs.readFileSync('test/app/flash/init.jinx', 'utf8');
const as3Code = compile(jinxContent);
console.log(as3Code);