
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
brunch-preval
Advanced tools
Simple JS based preprocessing for Brunch static HTML files.
$ npm i brunch-preval
Simply open a static HTML file and put some javascript inside {{ double curly braces }}. The javascript will be evaluated, and the results will be interpolated in its place.
<html><body>{{ Math.random() }}</body></html>
Use the backslash (\) character to escape a replacement
<html><body>\{{ This won't be processed. }}</body></html>
Backslashes may also be used to escape a backslash.
<html>
<body>
{{ "This WILL be processed." }}
\{{ "This won't be processed."" }}
\\{{ "This WILL be processed and will be preceeded by a single backslash." }}
\\\{{ "This won't be processed and will be preceeded by a single backslash." }}
\\\\{{ "This WILL be processed and will be preceeded by a 2 backslashes." }}
</body>
</html>
<<< triple angle brackets >>> or ((( triple parens ))) may also be used.
See also configuring Brunch
You can more finely control which HTML files are processed by specifying a regex for the include & exclude keys.
If a file matches both include and exclude the include will take precedence.
exports.plugins = {
preval:{
exclude: /thing.html$/,
, include: /something.html$/,
}
};
Tokens can be specified in your Brunch config.
Tokens may be static values or the results of a function. Dynamic tokens will be generated once per compile pass, and will have the same value for all files processed in each pass.
Tokens in templates can be accessed on the _ object.
<html><body>{{ _.BUILD_TIME }}</body></html>
exports.plugins = {
preval:{
tokens: {
STATIC_VAL: 'Some value',
BUILD_TIME: ()=>(new Date).getTime() / 1000,
}
}
};
Set log to false in your Brunch config to stop BrunchPreval from logging to the console during compilation.
exports.plugins = {
preval:{
log: false
}
};
FAQs
Preprocess static HTML files in Brunch with plain JS.
We found that brunch-preval 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
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.