
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Handlebars templates for CLIs! Now you can groom your stash on the command line too. Now with colors!
If you're building a CLI and want to keep the nasty string manipulations out your well crafted code, use this.
First add stashed to your deps or install manually:
npm i stashed
Next:
var stashed = require('stashed');
var render = stashed({
templateDir: "./templates"
});
console.log(render('basics'));
console.log(render('with_binds',{
answer: "two",
name: "Rich"
}));
Inside ./templates/basics.hbs, you'll find:
{{#rainbow}}Skittles, taste the rainbow{{/rainbow}}
Which will render this in your terminal:

Inside ./templates/with_binds.hbs, you'll find:
This template has some binds:
1 + 1 = {{answer}}
Hello {{#inverse}}{{name}}{{/inverse}}!
This will render:

render( <String::filename_of_template_wo_ext>,
[Object::context_object],
[Boolean::strip_colors] )
Stashed uses @marak's awesome colors.js. Stashed exposes colors.js' colors and styles as Handlebars block helpers:
To use these, all you have to do is wrap your text with {{#style}}text{{/style}}. You can nest styles too.
Go nuts, but don't forget to send me some pull requests!
FAQs
Handlebars templates for CLIs
The npm package stashed receives a total of 61 weekly downloads. As such, stashed popularity was classified as not popular.
We found that stashed 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.