Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.