
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
Make npm3's node_modules folder easier to find and sort on OS X
npm3 has flat dependency trees, this is a good thing for many reasons.
Unfortunately, this means your node_modules folder might contain hundreds (or thousands?)
of modules and that makes it difficult to quickly debug/hack on issues with top-level dependencies.
John is your man. He puts color tags on your top-level dependencies and devDependencies, this makes your top-level dependencies easier to find and sort.
Note: This project is currently OS X only, but if you have ideas on how something similar could be implemented other platforms then create an issue.

$ npm install --global john
$ john --help
Make npm3's node_modules folder easier to find and sort on OS X
Usage
$ john
Options
--clear Clear all tags. [Default: false]
--deps Color for dependencies. [Default: blue]
--dev-deps Color for devDependencies. [Default: yellow]
Available Colors:
gray, green, purple, blue, yellow, red, orange, clear.
Examples
$ john
Tagged 4 dependencies as blue
Tagged 2 devDependencies as yellow
$ john --clear
Removed 4 tags from dependencies
Removed 2 tags from devDependencies
$ john --deps=purple --dev-deps=gray
Tagged 4 dependencies as purple
Tagged 2 devDependencies as gray
$ npm install --save john
const john = require('john');
john('/path/to/project').then(
(result) => console.log(result)
// {
// dependencies: [
// { code: 0,
// command: 'xattr …',
// path: '/path/to/project/node_modules/finder-tag',
// tag: 'blue',
// module: 'finder-tag'
// },
// {…},
// {…}
// ],
// devDependencies: [
// {…},
// {…}
// ]
// }
)
Type: string
The path to your projects root directory (that contains package.json).
Type: boolean
Default: false
Clear all tags.
Type: string
Default: blue
Color tag to use for dependencies.
Available Colors:
Type: string
Default: yellow
Color tag to use for devDependencies. See available colors above.
MIT © DaveJ
FAQs
Make npm3's flat dependencies easier to find and sort
We found that john 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.