Undocumented npm view json switch #2992

Closed
squarism opened this Issue Dec 10, 2012 · 2 comments

Projects

None yet

2 participants

@squarism

(At first I thought npm view was returning invalid json ...)
$ npm view ${anything}
Returns invalid JSON.

For example:
npm view connect dist { shasum: 'b869df9acf3dd8a0af7523c7c6f1aa8b4b761daa', tarball: 'http://registry.npmjs.org/connect/-/connect-2.7.1.tgz' }

json.org says only double quoted strings are allowed. Is this supposed to be JSON or "jsdom output"? It might be valid.

Update: Ok nevermind, --json switch works but npm help view does not list it as an option.
npm view connect dist --json

@nathan7
Member
nathan7 commented Dec 12, 2012

It's a valid JS object literal. JSON is a rather strict subset of JS object literals (it stands for JavaScript Object Notation).

@squarism

Ok @nathan7, thanks for the info. I left this issue open just for the undocumented --json switch.

@nathan7 nathan7 closed this in 2915f61 Dec 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment