Registry / devops / multic

multic

JSON →
library0.6.0jsnpmunverified

Multic is a Node.js library providing a converged API for compiling, minifying, and linting multiple web source formats including Jade/Pug, HTML, Less, Sass/SCSS, CSS, CoffeeScript, ES6 via Babel, JavaScript, and Angular HTML2JS. Version 0.6.0 is the latest stable release. It aims to unify error handling and configuration across different preprocessors with a consistent promise/callback interface. Key differentiators include a chainable API, unified error/warning objects, and support for writing output files directly. Release cadence is low; the library appears to be in maintenance mode with no recent updates.

npm install multic
INSTALL
IMPORT
SIG · MULTIC
M
multic
devopsjavascriptv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
var multic = require('multic');
import multic from 'multic';
This package does not export TypeScript types and is CommonJS-only for Node.js. ESM import is not supported.
default (with TypeScript)
import multic = require('multic');
import * as multic from 'multic';
For TypeScript with esModuleInterop, use import = require(). The library has no type definitions.
Promise usage
multic('file.jade').file.jade.html().then(res => console.log(res));
multic('file.jade').file.jade.html(function(err, res){});
Both promise and callback are supported. The callback signature is (err, res).

Demonstrates the chainable API for compiling Jade to HTML, minifying JavaScript, and handling responses with promises/callbacks.

var multic = require('multic'); // Compile a Jade file to HTML and write output multic('template.jade').file.jade.html().write('output.html', function(err, res) { if (err) { console.error('Compilation error:', err); } else { console.log('Compiled to output.html'); } }); // Minify a JavaScript string var script = 'function hello() { return "world"; }'; multic(script, {file: 'hello.js'}).js.min().then(function(res) { console.log('Minified:', res.minified); }).catch(function(err) { console.error('Error:', err); }); // Compile Sass and get errors/warnings multic('style.scss').file.sass.css().then(function(res) { if (res.errors.length > 0) { res.errors.forEach(function(e) { console.error(e.message); }); } else { console.log('Compiled CSS:', res.compiled); } });
Debug
Known issues
gotchaThe .file() method is required when providing a string source directly (not via file path) to specify the source file name for error reporting and extension detection.
fix
Always include options.file or use .file() chain method when passing raw source strings.
affects: >=0.0.0
gotchaMulti-step chains like .less.css.min() require the intermediate compilation step even if not outputting; omitting .css() before .min() may produce unexpected results.
fix
Always include the compilation step (e.g., .css(), .html()) before .min().
affects: >=0.0.0
deprecatedThe ecmascript6/6to5/babel source format may use deprecated Babel 5; check dependencies.
fix
If using ES6 compilation, manually install babel-core v5 or migrate to a dedicated Babel pipeline.
affects: >=0.0.0
gotchaThe package has no TypeScript definitions; users must manually declare module or use @ts-ignore.
fix
Use require() with a .d.ts file: declare module 'multic';
affects: >=0.0.0
gotchaPromise chains must use .catch() for error handling; the callback style returns errors in the first argument of the callback.
fix
For promises, always attach .catch() to handle compilation/minification failures.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'multic'
Package not installed globally or in node_modules.
fix
Run 'npm install multic --save' in your project root.
TypeError: multic(...).file is undefined
Source argument missing or invalid; or using .file() without a string source.
fix
Ensure you call multic() with a valid source string or file path, then chain .file.* methods.
multic is not a function
Using ES6 import with the package (CommonJS-only).
fix
Use require('multic') instead of import.
Error: The 'file' property must be available and must be an optional or mandatory option.
When passing raw source code, you must provide options.file or use .file() to supply a filename.
fix
Add {file: 'filename.ext'} as second argument to multic(), or use .file('filename.ext') in the chain.
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
packagemultic
multic — npm install multic · libregistry