Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CoffeeScript JavaScript

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
src
test
.gitignore
CHANGELOG.md
README.md
env.json
gulpfile.coffee
gulpfile.js
package.json

README.md

npmlist

NPM
version

Sugar wrapped npm list with optional depth

Project initiated using nblocks

Why?

Current npm's (v1.4.3 and v.1.4.4) list (ls) function at depth=0 is broken. npm list depth=n is now fixed, but this looks aesthetically better than the original (such colors. oooohh~)

Usage

Installation

  $ npm install -g npmlist

Usage (sans color)

  $ npmlist
  Installed npm packages: (global)

  bower....................[1.2.8]
  brewcleaner..............[1.1.0]
  chai.....................[1.9.0]
  coffee-script............[1.7.1]
  connect.................[2.13.0]
  dispatch-proxy...........[0.1.2]
  express..................[3.4.8]
  gulp.....................[3.5.2]
  mocha..................[1.17.1*]
  nodemon.................[1.0.15]
  npm......................[1.4.4]
  yo.......................[1.1.2]

An asterisk by a version name signifies you are using a linked version of the package rather than one installed from a registry.

Other options include:

Help

Display help message

Version

Display version number

Local

List local packages

Global

List global packages

Colorscheme

Displays current color scheme. More on color below in Color Customization

Depth

Specify depth to display (same as npm's depth)

Filtering

Filter by package name (prepend _ for fuzzy match)

Colors

Uses colors (one-off)

Set Color

Set colors for persistence i.e. default colors

Set Scope

Set scope for persistence i.e. default scope

Color Customization

The color of the output can be changed through a few options.

  # One-off colorscheme
  $ npmlist -c=red,yellow,blue,magenta,cyan
  ...

  # Setting persistent colorscheme
  $ npmlist -s=red,yellow,blue,magenta,cyan

  Current colorscheme:

  Package...................red
  Version................yellow
  Banner...................blue
  Dots..................magenta
  Sub-package..............cyan

  # Get current colorscheme
  $ npmlist -k

  Current colorscheme:

  Package...................red
  Version................yellow
  Banner...................blue
  Dots..................magenta
  Sub-package..............cyan

As you can see from above, there are five variable colors for npmlist: Package name, version, banner, dots, and sub-packages. When specifying more than 1 color, they will populate in the order as above. When only one color is given, everything will be that color. The default colorscheme is the same as previous versions of npmlist:

defaultColors =
COLORS =
  pkg:      'magenta'
  version:  'cyan'
  banner:   'blue'
  dots:     'grey'
  subpkg:   'grey'

For persistent color settings, the colors are saved as a variable in $HOME/.npmrc as npmlist.colors.

To see what colors are avaialble, check out colors here.

Future Plans

  • Allow for package filtering (useful for > 0 depth view of a package)
  • Fix empty module list from throwing error
  • Signify if using linked package or installed
  • Fix extraneous package mark
  • Better package versioning...
  • Refactor out CLI parser (or use optimist?)
  • Clean up code
  • Possibly use npm depth=0 now that it is fixed

Credits

nblocks

License

Copyright © Nicholas Hwang nick.joosung.hwang@gmail.com

Something went wrong with that request. Please try again.