
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
expand-template
Advanced tools
Expand placeholders in a template string.
$ npm i expand-template -S
Default functionality expands templates using {} as separators for string placeholders.
var expand = require('expand-template')()
var template = '{foo}/{foo}/{bar}/{bar}'
console.log(expand(template, {
foo: 'BAR',
bar: 'FOO'
}))
// -> BAR/BAR/FOO/FOO
Custom separators:
var expand = require('expand-template')({ sep: '[]' })
var template = '[foo]/[foo]/[bar]/[bar]'
console.log(expand(template, {
foo: 'BAR',
bar: 'FOO'
}))
// -> BAR/BAR/FOO/FOO
All code, unless stated otherwise, is dual-licensed under WTFPL and MIT.
Mustache is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. Compared to expand-template, Mustache offers a more complex syntax and functionality, including sections and inverted sections, but it might be overkill for simple string replacement tasks.
Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. It's an extension of Mustache with more features like helpers, partials, and more control structures. Handlebars is more feature-rich compared to expand-template, making it suitable for more complex templating needs but potentially heavier for simple tasks.
FAQs
Expand placeholders in a template string
We found that expand-template 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.