
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
consolidate-build
Advanced tools
Does for languages that can be 'built' what consolidate.js does for templates
Does for languages that can be 'built' what consolidate.js does for templates
$ npm install consolidate-build
All template engines supported by consolidate work in consolidate-build.
In addition to those, consolidate build adds:
NOTE: you must still install the engines you wish to use, add them to your package.json dependencies.
All templates supported by this library may be rendered using the signature (path[, locals], callback)
or .render(str[, locals], callback)
as shown below.
NOTE: All this example code uses build.less for the less stylsheet language. Replace less with whatever language you are using. For exmaple, use build.stylus for stylus, build.markdown or build.md for markdown, etc. console.log(build)
for the full list of identifiers.
var build = require('consolidate-build');
build.less('styles/style.less', { compress: true }, function(err, css){
if (err) throw err;
console.log(css);
});
Or without options / local variables:
var build = require('consolidate-build');
build.less('styles/style.less', function(err, css){
if (err) throw err;
console.log(css);
});
To dynamically pass the engine, simply use the subscript operator and a variable:
var build = require('consolidate-build')
, name = 'less';
build[name]('styles/style.css', function(err, css){
if (err) throw err;
console.log(css);
});
All the languages support being built without a file being present. To do this ismply use the render method.
build.less.render('.class { width: 1 + 1 }', { compress: true}, function(err, css){
if (err) throw err;
console.log(css);
});
FAQs
Does for languages that can be 'built' what consolidate.js does for templates
We found that consolidate-build demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.