Socket
Book a DemoInstallSign in
Socket

john

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

john

Make npm3's node_modules folder easier to find and sort on OS X

Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

john Build Status

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.

CLI

$ 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

Using Programmatically

Install

$ npm install --save john

Usage

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: [
  //     {…},
  //     {…}
  //   ]
  // }
)

API

john(projectPath, [options])

projectPath

Type: string

The path to your projects root directory (that contains package.json).

options

clear

Type: boolean
Default: false

Clear all tags.

dependencyColor

Type: string
Default: blue

Color tag to use for dependencies.

Available Colors:

  • gray
  • green
  • purple
  • blue
  • yellow
  • red
  • orange
  • clear
devDependencyColor

Type: string
Default: yellow

Color tag to use for devDependencies. See available colors above.

License

MIT © DaveJ

Keywords

cli-app

FAQs

Package last updated on 19 Jan 2016

Did you know?

Socket

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.

Install

Related posts