Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Undocumented npm view json switch #2992

Closed
squarism opened this Issue · 2 comments

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
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.