Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parseable output from NPM

Tags:

node.js

npm

I am trying to write a small application that wraps some functions inside of NPM from another language. "npm list" is giving me output with a nice visual tree, but I need something easier to parse. -parsable is giving me a flat list of modules, but I would like to have some of the metadata available in "npm ll". Is there a switch or something for NPM that lets me get JSON output? Right now the only way I can figure to do this is to write a node app that uses the npm module to push json to the standard output.

like image 249
Justin Beckwith Avatar asked Dec 06 '22 17:12

Justin Beckwith


1 Answers

I think you want to do

npm ls -json
like image 54
Josmar Avatar answered Dec 11 '22 08:12

Josmar