
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
strip-whitespace
Advanced tools
Strip-Whitespace will remove extraneous spaces from strings. It's perfect for working with rendering templates (ex. mustache, handlebars) or es6 javascript templates. It works with anything where you might create very long strings.
function() {
if (condition) {
const longString = ' String with some extra spaces ';
}
}
function() {
if (condition) {
const longString = ' String with some extra spaces ';
}
}
$ strip-whitespace --input <input-file> --output <output-file>
var StripWhitespace = require('strip-whitespace');
// options are optional and can be omitted
var stripWhitespace = new StripWhitespace(options);
var result = stripWhitespace.strip(code);
// do things with the code
code = result.code;
All options are optional
{
shouldStripWhitespace: function(fatString) {
// following code will answer the question: should this string be stripped of whitespace?
if (fatString.startsWith('DO NOT MODIFY THIS STRING')) {
return false;
}
return true;
}
}
FAQs
Strip whitespace in strings from javascript assets
The npm package strip-whitespace receives a total of 690 weekly downloads. As such, strip-whitespace popularity was classified as not popular.
We found that strip-whitespace 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.