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.
Simplified speed-oriented JavaScript equivalent of the C/PHP sprintf
function.
npm install cjs-format
Add to the scope:
var format = require('cjs-format');
Simple replacement:
// This is a cat
console.log(format('This is a {0}', 'cat'));
Multiple replacement:
// This is a cat and a dog
console.log(format('This is a {0} and a {1}', 'cat', 'dog'));
Replacement with changed order:
// This is a cat and a dog and another cat
console.log(format('This is a {0} and a {1} and another {0}', 'cat', 'dog'));
There is a global var
DEBUG
which activates additional consistency checks and protection logic not available in release mode.
If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.
cjs-format
is released under the GPL-3.0 License.
FAQs
String substitution according to the given format.
The npm package cjs-format receives a total of 20 weekly downloads. As such, cjs-format popularity was classified as not popular.
We found that cjs-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.