get-package

2019-08-14

get-package是什么

什么是get-package,Get package.json from disk/npm depending on the path

get-package使用教程帮助文档

get-package Build Status

Get package.json from disk/npm depending on the path/name

Install

$ npm install --save get-package

Usage

var getPackage = require('get-package')

getPackage('xtend', callback)
//=> gets latest xtend package.json from npm

getPackage('./node_modules/xtend', callback)
//=> gets package.json from xtend on disk

API

getPackage(name, [options], callback) -> undefined

name

Required Type: string

A valid package name or path. Relative paths must begin with a . to be detected.

options
version

Type: string Default: latest

The version to fetch. If the local version does not match, npm will be queried even when name is a local path.

cwd

Type: string Default: process.cwd()

callback

Required Type: function Arguments: err, json

A callback that will receive the parsed JSON of the package.

License

MIT © Ben Drucker


上一篇:is-package
下一篇:get-package-dir
相关文章

首次访问,人机识别验证

扫描下方二维码回复 1024 获取验证码,验证完毕后 永久 无须验证

操作步骤:[打开微信]->[扫描上侧二维码]->[关注 FedJavaScript 的微信] 输入 1024 获取验证码

验证码有误,请重新输入