Skip to content

Feature: make npm view for current project easier #6390

@RobinKnipe

Description

@RobinKnipe

Currently using npm view will return information about the project associated with the current working directory. This is very useful, but to use any of the extended options of the command (like [<field>[.subfield]...]) requires supplying a package name.

npm view
# information about the local project from the registry indicated by package.json

npm view <package>
# information from the registry about the specified package

npm view <package> version
# the latest version of the specified package

# possibly the same as the above for the local project, but not as friendly :(
npm view `npm pkg get name | tr -d '"'` version

Feature - consider a shorthand for the local context, e.g.

npm view - version
# uses the local package.json to work out the registry and latest published version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions