roole-compiler
raw JSON → 0.6.0 verified Fri May 01 auth: no javascript abandoned
Roole compiler converts Roole CSS AST (from roole-parser) into CSS string. Version 0.6.0 is the latest and only stable release, with no updates since 2016. It is a standalone component of the Roole preprocessor ecosystem. Differentiator: direct AST-to-CSS compilation with configurable indentation and numeric precision. Limited adoption and no active maintenance.
Common errors
error Cannot find module 'roole-compiler' ↓
cause Package is not installed or not found in node_modules.
fix
Run 'npm install roole-compiler'.
error compiler.compile is not a function ↓
cause Using ES6 import style on a CommonJS module.
fix
Use require('roole-compiler') instead of import.
Warnings
gotcha Compiler expects AST from roole-parser exactly; incompatible with other parsers. ↓
fix Always pair roole-compiler with roole-parser.
deprecated Project is unmaintained since 2016; no updates or security patches. ↓
fix Consider migrating to a modern CSS preprocessor like PostCSS or Sass.
gotcha No error handling for malformed AST; compile may throw unhelpful errors. ↓
fix Validate AST with roole-parser before compiling.
Install
npm install roole-compiler yarn add roole-compiler pnpm add roole-compiler Imports
- compile wrong
import { compile } from 'roole-compiler'; // ESM not supportedcorrectvar compiler = require('roole-compiler'); compiler.compile(ast); - compiler wrong
// None; only CommonJS pattern existscorrectvar compiler = require('roole-compiler'); - compile wrong
require('roole-compiler').compile(ast); // requires .compile explicitlycorrectconst compiler = require('roole-compiler'); const str = compiler.compile(ast, { indent: ' ', precision: 2 });
Quickstart
var parser = require('roole-parser');
var compiler = require('roole-compiler');
var ast = parser.parse('body { margin: 0 }');
var str = compiler.compile(ast);
console.log(str);
// Output:
// body {
// margin: 0;
// }