Installations
npm install @swordjs/read-pkg-up
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Min. Node Version
^12.20.0 || ^14.13.1 || >=16.0.0
Node Version
16.12.0
NPM Version
9.4.0
Score
66.7
Supply Chain
88.6
Quality
74.6
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (54.21%)
JavaScript (45.79%)
Developer
sindresorhus
Download Statistics
Total Downloads
381
Last Day
1
Last Week
6
Last Month
14
Last Year
79
GitHub Statistics
264 Stars
44 Commits
19 Forks
8 Watching
1 Branches
9 Contributors
Bundle Size
82.87 kB
Minified
29.43 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
9.1.1
Package Id
@swordjs/read-pkg-up@9.1.1
Unpacked Size
7.39 kB
Size
2.76 kB
File Count
6
NPM Version
9.4.0
Node Version
16.12.0
Publised On
13 Mar 2023
Total Downloads
Cumulative downloads
Total Downloads
381
Last day
0%
1
Compared to previous day
Last week
200%
6
Compared to previous week
Last month
75%
14
Compared to previous month
Last year
-73.8%
79
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
read-pkg-up
Read the closest package.json file
Why
Install
1npm install read-pkg-up
Usage
1import {readPackageUp} from 'read-pkg-up'; 2 3console.log(await readPackageUp()); 4/* 5{ 6 packageJson: { 7 name: 'awesome-package', 8 version: '1.0.0', 9 … 10 }, 11 path: '/Users/sindresorhus/dev/awesome-package/package.json' 12} 13*/
API
readPackageUp(options?)
Returns a Promise<object>
or Promise<undefined>
if no package.json
was found.
readPackageUpSync(options?)
Returns the result object or undefined
if no package.json
was found.
options
Type: object
cwd
Type: URL | string
Default: process.cwd()
The directory to start looking for a package.json file.
normalize
Type: boolean
Default: true
Normalize the package data.
read-pkg-up for enterprise
Available as part of the Tidelift Subscription.
The maintainers of read-pkg-up and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Related
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No security vulnerabilities found.