display list of packages in a format (default is terse)
Filters take may subfilter with the syntax subfilter=pattern, if you need multiple subfilters separate them by commas, by default all filters must be matched to return a package. For filters on a set of data such as authors the filter only needs to match 1 entry out of the set.
...|"..."
/.../
[<>!]?=... Check if comparison matches a semantic variable, else check if it is a number (number compared against date is comparison against number of milliseconds since 1970), else a date, else a string.
Any filter without a subfilter is considered 'generic'. Generic filters are applied to all aspects of a package. Filters following a subfilter will only be applied to a specific part of a package.
package name
package tag
package version (non-url)
package installed version (non-url)
package stable version (non-url)
package latest version (non-url)
package maintainers (name and email)
package creation time (in UTC)
package modified time (in UTC)
package description
extend the display to
----------------------
Package Name
__[maintainers (name - email , ...)]__
- - - - - - - - - - -
[installed@version] [stable@version] __[latest@version]__
DESCRIPTION:
[description]
TAGS: __[tags]__
VERSIONS: __[versions]__
----------------------
trim the display to
Package Name [installed@version] [stable@version]
if format did not match a prebuilt format, it will be interpretted by mustache.js syntax rules with the following additions
Enumerables may now be sliced into sections of themselves while enumerating using '[' x '..' y ']', 0 based, inclusive on both ends. Slices allow access to {{|}} for length and {{@}} for index.
{ name: '', authors: [{name:'',email:''},], versions: {stable:'',installed:['',],latest:'',active:''}, modules: {'x.y.z':{url:''}} description: '' created: Date modified: Date }
search only installed packages
orders according to number of times a filter matched (matches of same count will be ordered alphabetically)
reverse the order (ie. name-reverse)
include partial matches (use orderby for having them put at top/bottom)
given a local registry of: { foo: { '1.0.1': { active: true } }
and a remote registry of: { name: 'bar' , description: 'not foo' , 'dist-tags': { latest: '2.2.2', stable: '1.1.1' } , maintainers: [ { name: 'null', email: '[email protected]' } ] , mtime: '2010-01-11T12:00:00Z' , ctime: '2010-01-01T00:00:00Z' , versions: { '0.0.0': 'http://registry.npmjs.org/bar/0.0.0' , '1.1.1': 'http://registry.npmjs.org/bar/1.1.1' , '2.2.2': 'http://registry.npmjs.org/bar/2.2.2' } } { name: 'foo' , description: 'not bar' , 'dist-tags': { latest: '1.2.3', stable: '1.0.1' } , maintainers: [ { name: 'void', email: '[email protected]' }, { name: 'not', email: '[email protected]' } ] , mtime: '2010-01-11T12:00:00Z' , ctime: '2010-01-01T00:00:00Z' , versions: { '0.0.0': 'http://registry.npmjs.org/foo/0.0.0' , '1.0.1': 'http://registry.npmjs.org/foo/1.0.1' , '1.2.3': 'http://registry.npmjs.org/foo/1.2.3' } }
- npm ls --local
A simple search of installed packages.
-----------------
foo
- - - - - - - - -
[email protected] [email protected] [email protected]
not bar
-----------------
- npm ls --registry local --format verbose
A more verbose search of installed packages.
-----------------
foo
void - [email protected], not - [email protected]
- - - - - - - - -
[email protected] [email protected] [email protected]
DESCRIPTION:
not bar
TAGS: installed, stable
VERSIONS: 0.0.0, 1.0.1
-----------------
- npm ls --orderby name-reverse
Reverse the natural order of the packages. Same as --orderby -reverse.
-----------------
foo
- - - - - - - - -
[email protected] [email protected] [email protected]
not bar
-----------------
bar
- - - - - - - - -
[email protected] [email protected]
not foo
-----------------
- npm ls version=/^1.\d/ --orderby latest-reverse
This would match any version above 1 and is equivalent to: npm ls -version >=1.0.0, npm ls -version >=1. This matches both and since the lastest version of foo is less than bar, it comes first.
-----------------
foo
- - - - - - - - -
[email protected] [email protected] [email protected]
not bar
-----------------
bar
- - - - - - - - -
[email protected] [email protected]
not foo
-----------------
-
npm ls --format terse
Replied on the list. Thanks!