Registry / devops / mermin

mermin

JSON →
library0.1.6jsnpmunverified

Mermin is a resource manager for Express/Connect applications that merges, minifies, and compiles JavaScript, CSS, and LESS files. Version 0.1.6 (stable, last updated 2012) provides a declarative configuration to define file groups, automatically merges files per project, and exposes a dynamic helper for use in template engines like Jade or EJS. It relies on UglifyJS for JS minification and CSSo for CSS minification. Notable for its simplicity and built-in support for LESS compilation, but no longer maintained.

npm install mermin
INSTALL
IMPORT
SIG · MERMIN
M
mermin
devopsjavascriptv0.1.6
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.

mermin
var mermin = require('mermin');
import mermin from 'mermin';
Package is CommonJS only; ESM import not supported.

Demonstrates setting up mermin with configuration, initialization, merging, and adding dynamic helper for Express.

var mermin = require('mermin'); // Extend to support custom processing (optional) mermin.extend('css', function(data, writePath, minify) { if (minify) { // minification logic with csso } else { require('fs').writeFileSync(writePath, data); } }); // Configuration: types and groups var config = { 'js': { 'app': ['/js/file1.js', '/js/file2.js'] }, 'css': { 'app': ['/css/style.css'] } }; // Initialize with public directory mermin.init(__dirname + '/public/', config); // Merge and minify mermin.merge(true); // In Express app app.dynamicHelpers(mermin.dynamicHelper); // Then in template: // each url in mermin.js.app // script(src=url)
Debug
Known issues
deprecatedPackage is no longer maintained; last release 2012. May have security vulnerabilities in dependencies.
fix
Consider using modern alternatives like gulp, webpack, or esbuild.
affects: *
gotchaDynamic helpers are deprecated in Express 3+ and removed in Express 4.
fix
Use app.locals or res.locals instead of app.dynamicHelpers().
affects: >=3.0.0
breakingThe extend method signature expects a function with (data, writePath, minify) but csso API has changed; csso.justDoIt may not exist.
fix
Update custom processor to use current csso minify methods.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'mermin'
Package not installed or not in node_modules.
fix
Run npm install mermin in your project root.
TypeError: app.dynamicHelpers is not a function
Express 4 removed dynamicHelpers.
fix
Use app.locals.mermin = mermin.dynamicHelper; or assign directly to res.locals.
ReferenceError: csso is not defined
Custom extend function references csso without requiring it.
fix
Add var csso = require('csso'); at top of file.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies
asyncrequiredUsed for asynchronous control flow during merge operations
cssorequiredCSS minification and optimization
lessrequiredLESS to CSS compilation
uglify-jsrequiredJavaScript minification
Agent activity
2 hits · last 30 days
node
2
Resources
packagemermin
mermin — npm install mermin · libregistry