Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
anti-matter
Advanced tools
Flexible command line documentation generation
You are writing a command line tool in node, and it needs help and usage commands. At the moment, the only simple option is to use the built-in doc generation abilities of a popular arg parser like optimist or commander, but if you don't exclusively use flags for your command line tool, or you have more complex and/or nested command sets, this can end up being messy or impossible.
Antimatter attempts to solve this problem as a tool specifically for documenting command line interfaces in as simple and east-to-read a manner as possible, regardless of how the interface works or how complicated it is.
npm install antimatter
Antimatter makes no assumptions about how you have set up your command line interface, it just provides functions that make generating the documentation easier. Let's take a look at a high level example before we dive into it.
var antimatter = require('antimatter');
antimatter({
title: 'roots cli',
options: { log: true },
commands: [{
name: 'watch',
required: 'folder',
optional: ['--no-open', '--no-livereload']
description: 'watches your project for changes and reloads when detected'
}, {
name: 'compile',
optional: 'path',
description: 'compiles your project once to the provided <path> or the current directory'
}]
});
At the moment, antimatter only has one root function - it takes an optional title/header for the doc block, an optional object of options, and either an object or array of objects that represent documented commands. By default it will output a colored and formatted string, ready to print to the command line -- if you pass { log: true }
into the options as above, it will console.log
it for you. Here's a screenshot of what the above would look like in your terminal.
The antimatter function takes an object with three potential properties, title (optional), options (optional), and commands.
String, serves as the header on the set of documented commands. Optional.
console.log
the outputEither an object or array of objects that detail the command or commands you are documenting. Each object can have a few keys:
FAQs
flexible command line documentation
The npm package anti-matter receives a total of 6 weekly downloads. As such, anti-matter popularity was classified as not popular.
We found that anti-matter 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.