-
read-pkg-up:读取最近的package.json文件下载
资源介绍
读取pkg-up
读取最近的package.json文件
为什么
安装
$ npm install read-pkg-up
用法
import { readPackageUpAsync } from 'read-pkg-up' ;
console . log ( await readPackageUpAsync ( ) ) ;
/*
{
packageJson: {
name: 'awesome-package',
version: '1.0.0',
…
},
path: '/Users/sindresorhus/dev/awesome-package/package.json'
}
*/
原料药
readPackageUpAsync(options?)
如果未找到package.json则返回Promise<object>或Promise 。