Gathering detailed insights and metrics for read-package-json-fast
Gathering detailed insights and metrics for read-package-json-fast
Gathering detailed insights and metrics for read-package-json-fast
Gathering detailed insights and metrics for read-package-json-fast
@firanorg/mollitia-molestias-accusamus
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
@taktikorg/unde-animi-omnis
<p align="center"> <a href="https://www.npmjs.com/package/@taktikorg/unde-animi-omnis"><img src="https://img.shields.io/npm/v/@taktikorg/unde-animi-omnis"></a> <a href=""><img src="https://img.shields.io/github/actions/workflow/status/RemiMyrset/@taktikor
@crabas0npm2/impedit-porro-maiores
security holding package
@crabas0npm2/perspiciatis-rerum-blanditiis
security holding package
npm install read-package-json-fast
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.4
Supply Chain
91.9
Quality
82.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
1,065,390,050
Last Day
370,812
Last Week
6,887,556
Last Month
29,738,553
Last Year
336,630,092
ISC License
49 Stars
107 Commits
6 Forks
6 Watchers
3 Branches
69 Contributors
Updated on Jun 26, 2025
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
read-package-json-fast@4.0.0
Unpacked Size
8.48 kB
Size
3.75 kB
File Count
4
NPM Version
10.8.3
Node Version
22.9.0
Published on
Sep 25, 2024
Cumulative downloads
Total Downloads
Last Day
-7.9%
370,812
Compared to previous day
Last Week
-7.4%
6,887,556
Compared to previous week
Last Month
2.2%
29,738,553
Compared to previous month
Last Year
9.8%
336,630,092
Compared to previous year
3
Like read-package-json
, but faster and
more accepting of "missing" data.
This is only suitable for reading package.json files in a node_modules tree, since it doesn't do the various cleanups, normalization, and warnings that are beneficial at the root level in a package being published.
1const rpj = require('read-package-json-fast') 2 3// typical promisey type API 4rpj('/path/to/package.json') 5 .then(data => ...) 6 .catch(er => ...) 7 8// or just normalize a package manifest 9const normalized = rpj.normalize(packageJsonObject)
Errors raised from parsing will use
json-parse-even-better-errors
,
so they'll be of type JSONParseError
and have a code: 'EJSONPARSE'
property. Errors will also always have a path
member referring to the
path originally passed into the function.
To preserve indentation when the file is saved back to disk, use
data[Symbol.for('indent')]
as the third argument to JSON.stringify
, and
if you want to preserve windows \r\n
newlines, replace the \n
chars in
the string with data[Symbol.for('newline')]
.
For example:
1const data = await readPackageJsonFast('./package.json') 2const indent = Symbol.for('indent') 3const newline = Symbol.for('newline') 4// .. do some stuff to the data .. 5const string = JSON.stringify(data, null, data[indent]) + '\n' 6const eolFixed = data[newline] === '\n' ? string 7 : string.replace(/\n/g, data[newline]) 8await writeFile('./package.json', eolFixed)
Indentation is determined by looking at the whitespace between the initial
{
and the first "
that follows it. If you have lots of weird
inconsistent indentation, then it won't track that or give you any way to
preserve it. Whether this is a bug or a feature is debatable ;)
bundledDependencies
/bundleDependencies
naming to just
bundleDependencies
(without the extra d
)true
, false
, or object values passed to bundleDependencies
funding: <string>
to funding: { url: <string> }
scripts
members that are not a string value.bin
member to { [name]: bin }
.optionalDependencies
into dependencies
._id
property if name and version are set. (This is
load-bearing in a few places within the npm CLI.)README.md
file, or attach the readme to
the parsed data object.HEAD
value out of the .git
folder.tset
instead of test
)files
field exist and are
valid files.dependencies
.dependencies
fields that are not strictly objects of string values.directories
field (ie, bins, mans, and so on).No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-23
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