![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
npm-audit-report
Advanced tools
Given a response from the npm security api, render it into a variety of security reports
Given a response from the npm security api, render it into a variety of security reports
The response is an object that contains an output string (the report) and a suggested exitCode.
{
report: 'string that contains the security report',
exit: 1
}
This is intended to be used along with
@npmcli/arborist
's AuditReport
class.
'use strict'
const Report = require('npm-audit-report')
const options = {
reporter: 'json'
}
const arb = new Arborist({ path: '/path/to/project' })
arb.audit().then(report => {
const result = new Report(report, options)
console.log(result.output)
process.exitCode = result.exitCode
})
Version 5 and 6 of the npm CLI make a request to the registry endpoint at
either the "Full Audit" endpoint at /-/npm/v1/security/audits
or
the "Quick Audit" endpoint at /-/npm/v1/security/audits/quick
. The Full
Audit endpoint calculates remediations necessary to correct problems based
on the shape of the tree.
As of npm v7, the logic of how the cli manages trees is dramatically
rearchitected, rendering much of the remediations no longer valid.
Thus, it only fetches the advisory data from the Quick Audit endpoint,
and uses @npmcli/arborist
to calculate
required remediations and affected nodes in the dependency graph. This
data is serialized and provided as an "auditReportVersion": 2
object.
Version 2 of this module expects to receive an instance (or serialized JSON
version of) the AuditReport
class from Arborist, which is returned by
arborist.audit()
and stored on the instance as arborist.auditReport
.
Eventually, a new endpoint may be added to move the @npmcli/arborist
work
to the server-side, in which case version 2 style audit reports may be
provided directly.
option | values | default | description |
---|---|---|---|
reporter | install , detail , json , quiet | install | specify which output format you want to use |
chalk | Chalk instance | required | a Chalk instance to use for colorizing strings. use new chalk.Instance({ level: 0 }) for no colors |
unicode | true , false | true | indicates if unicode characters should be used |
indent | Number or String | 2 | indentation for 'json' report |
auditLevel | 'info', 'low', 'moderate', 'high', 'critical', 'none' | low (ie, exit 0 if only info advisories are found) | level of vulnerability that will trigger a non-zero exit code (set to 'none' to always exit with a 0 status code) |
6.0.0 (2024-09-03)
npm-audit-report
now supports node ^18.17.0 || >=20.5.0
6ae4785
#137 run template-oss-apply (@hashtagchris)d9a9b5a
#135 bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])6a5ef6a
#123 bump @npmcli/template-oss to 4.22.0 (@lukekarrys)3dfcf02
#90 enable auto publish (#90) (@wraithgar)dfc6832
#136 postinstall for dependabot template-oss PR (@hashtagchris)ac3cfa2
#136 bump @npmcli/template-oss from 4.23.1 to 4.23.3 (@dependabot[bot])FAQs
Given a response from the npm security api, render it into a variety of security reports
The npm package npm-audit-report receives a total of 330,535 weekly downloads. As such, npm-audit-report popularity was classified as popular.
We found that npm-audit-report demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.