Spoon is a JavaScript transpiler that converts synchronous code into continuation-passing style (CPS) by identifying specified function calls and rewriting the surrounding code to use callbacks. It parses JavaScript using Esprima, constructs a High-Level Intermediate Representation (HIR) in the form of a Control Flow Graph (CFG), and then renders the transformed code back to JavaScript. Current stable version is 0.1.10, with no recent releases. It is primarily a proof-of-concept for transpilation techniques and is not actively maintained. Differentiators include low-level CFG manipulation and selective transpilation via declaration comments.
npm install spoonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpile code to use callbacks for specified function calls, with minimal configuration.
Always pass an array: spoon(code, ['funcName'], options)
Consider using modern alternatives like Babel plugins or Sweet.js for code transformation.
Limit uglify options to known UglifyJS options from version 1.x.
Install with: npm install spoon
Use: const spoon = require('spoon');Ensure you are using: const spoon = require('spoon');