node-compiler

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

A web compile tool (v0.1.2) for building pipelines of compilation tasks. It provides a plugin-based architecture where processing steps (e.g., transpilation, minification) are chained in a pipeline. Unlike monolithic build tools, it focuses solely on orchestrating compilers. Released as a minimal Node.js package with no stable release cadence; current version is pre-1.0. It differentiates by being lightweight and extensible via custom plugins.

error TypeError: compiler.use is not a function
cause Using default import incorrectly (CommonJS require instead of default import).
fix
Use import Compiler from 'compiler' or const Compiler = require('compiler').default;
error Error: Plugin must be a function
cause Passing non-function to .use().
fix
Ensure each argument to .use() is a function that takes input and returns output.
gotcha Plugin order matters; plugins are executed in the order they are added.
fix Ensure .use() calls are in the desired sequence.
breaking In v0.1.0, the plugin signature changed from (input, next) to (input) only, breaking existing custom plugins.
fix Update plugins to accept only input and return transformed string.
npm install compiler
yarn add compiler
pnpm add compiler

Basic pipeline usage: create a Compiler instance, add plugins via .use(), then run inputs through the pipeline.

import Compiler from 'compiler';

const compiler = new Compiler();

compiler.use(input => input.toUpperCase());
compiler.use(input => input + '!');

const result = compiler.run('hello');
console.log(result); // 'HELLO!'