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
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
945,933,837
Last Day
1,168,964
Last Week
5,377,581
Last Month
24,123,840
Last Year
334,832,989
47 Stars
104 Commits
6 Forks
7 Watching
4 Branches
71 Contributors
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
Publised On
25 Sept 2024
Cumulative downloads
Total Downloads
Last day
-6.2%
1,168,964
Compared to previous day
Last week
-14.7%
5,377,581
Compared to previous week
Last month
1.4%
24,123,840
Compared to previous month
Last year
21.8%
334,832,989
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
no binaries found in the repo
Reason
all changesets reviewed
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
project is not fuzzed
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
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@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
npackr
A nodejs CLI app to read package.json scripts faster
@womorg/adipisci-enim-illum
[![npm](https://img.shields.io/npm/v/@womorg/adipisci-enim-illum)](https://www.npmjs.com/package/@womorg/adipisci-enim-illum)