
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
code-strip
Advanced tools
A small library that removes compiler directives and the disabled code that goes along with it.
Note: Each directory passed in is searched recursively to find files in sub folders too.
npm install code-strip
or for command line: npm install -g code-strip
codeStrip(directories, fileTypes, directives, [options])
require(“code-strip”).docs()
var codeStrip = require(“code-strip”),
fs = require(“fs”)
codeStrip(“temp/dir”, “cs”, { ENABLED_DIRECTIVE: true })
var codeStrip = require(“code-strip”),
fs = require(“fs”)
codeStrip(
[“temp/dir”, “temp/dir2”],
[“cs”, “cpp”],
{ DIRECTIVE_0: true, DIRECTIVE_1: true }
)
code-strip “temp/dir” “cs” "DEFINE0:true"
or for multiple directories and fileTypes
code-strip “temp/dir,temp/dir2” “cs,cpp” "DEFINE0:true,DEFINE1:true"
with extra options
code-strip “temp/dir” “cs” "DEFINE0:true" —dontWrite
{
dontWrite: false,
ifTag: "#if ",
endifTag: "#endif",
elseTag: "#else",
elifTag: "#elif ",
writeTree: false
}
input:
#if ENABLED_DIRECTIVE
THIS LINE SHOULD EXIST
#endif
output:
THIS LINE SHOULD EXIST
npm test
FAQs
A node module that strips out compiler defines in code.
We found that code-strip 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.