Installations
npm install mos-read-pkg-up
Developer Guide
Typescript
No
Module System
N/A
Min. Node Version
>=0.10.0
Node Version
4.4.5
NPM Version
2.15.5
Score
62.8
Supply Chain
92.7
Quality
73.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
zkochan
Download Statistics
Total Downloads
38,333
Last Day
28
Last Week
36
Last Month
71
Last Year
2,193
GitHub Statistics
7 Commits
2 Watching
3 Branches
1 Contributors
Bundle Size
85.01 kB
Minified
27.03 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
mos-read-pkg-up@1.0.0
Size
2.48 kB
NPM Version
2.15.5
Node Version
4.4.5
Total Downloads
Cumulative downloads
Total Downloads
38,333
Last day
0%
28
Compared to previous day
Last week
3,500%
36
Compared to previous week
Last month
10.9%
71
Compared to previous month
Last year
89.7%
2,193
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
mos-read-pkg-up![Build status for master](https://img.shields.io/travis/zkochan/read-pkg-up/master.svg?style=flat)
Read the closest package.json file
Why
- Finds the closest package.json
- Gracefully handles filesystem issues
- Strips UTF-8 BOM
- Throws more helpful JSON errors
- Normalizes the data
Installation
This module is installed via npm:
1npm install mos-read-pkg-up --save
Usage
1const readPkgUp = require('mos-read-pkg-up'); 2 3readPkgUp().then(result => { 4 console.log(result); 5 //> { pkg: 6 // { name: 'mos-read-pkg-up', 7 // version: '1.0.2', 8 // description: 'Read the closest package.json file', 9 // license: 'MIT', 10 // repository: 11 // { type: 'git', 12 // url: 'git+ssh://git@github.com/zkochan/read-pkg-up.git' }, 13 // author: 14 // { name: 'Sindre Sorhus', 15 // email: 'sindresorhus@gmail.com', 16 // url: 'sindresorhus.com' }, 17 // engines: { node: '>=0.10.0' }, 18 // scripts: { test: 'xo && ava', md: 'mos' }, 19 // files: [ 'index.js' ], 20 // keywords: 21 // [ 'json', 22 // 'read', 23 // 'parse', 24 // 'file', 25 // 'fs', 26 // 'graceful', 27 // 'load', 28 // 'pkg', 29 // 'package', 30 // 'find', 31 // 'up', 32 // 'find-up', 33 // 'findup', 34 // 'look-up', 35 // 'look', 36 // 'file', 37 // 'search', 38 // 'match', 39 // 'package', 40 // 'resolve', 41 // 'parent', 42 // 'parents', 43 // 'folder', 44 // 'directory', 45 // 'dir', 46 // 'walk', 47 // 'walking', 48 // 'path' ], 49 // dependencies: { 'mos-read-pkg': '^1.1.2', 'find-up': '^1.0.0' }, 50 // devDependencies: { ava: '*', mos: '^0.16.0', xo: '*' }, 51 // bugs: { url: 'https://github.com/zkochan/read-pkg-up/issues' }, 52 // readme: 'ERROR: No README data found!', 53 // homepage: 'https://github.com/zkochan/read-pkg-up#readme', 54 // _id: 'mos-read-pkg-up@1.0.2' }, 55 // path: '/home/zoltan/src/read-pkg-up/package.json' } 56});
API
readPkgUp([options])
Returns a promise for the result object.
readPkgUp.sync([options])
Returns a result object.
options
cwd
Type: string
Default: .
Directory to start looking for a package.json file.
normalize
Type: boolean
Default: true
Normalize the package data.
Related
- read-pkg - Read a package.json file
- pkg-up - Find the closest package.json file
- find-up - Find a file by walking up parent directories
- pkg-conf - Get namespaced config from the closest package.json
License
MIT © Sindre Sorhus
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More