How to list npm user-installed packages?

How do I list the user-installed package ONLY in npm? When I do npm -g list it outputs every package and their dependencies, which is not what I want.

This works pretty well too: npm list -g --depth=0

You can get a list of all globally installed modules using:

ls `npm root -g`

One way might be to find the root directory of modules using:

npm root
/Users/me/repos/my_project/node_modules

And then list that directory...

ls /Users/me/repos/my_project/node_modules
grunt                   grunt-contrib-jshint

The user-installed packages in this case are grunt and grunt-contrib-jshint

Node_modules contains user-installed packages so change the directory to node_modules and list the items. Core Modules are defined in node's source in the lib/ folder.

Example:

     example@example:~/:~/node_modules$ ls
     express  maxmind-native  node-whois  socket.io  ua-parser-js
     geoip    mongoskin       pdfkit      tail       zeromq
     maxmind  nodemailer      request     ua-parser  zmq

To see list of all packages that are installed.

$ npm ls --parseable | awk '{gsub(/\/.*\//,"",$1); print}'| sort -u

show parseable of npm packages list https://docs.npmjs.com/cli/ls#parseable