namespace
Security
namespace Security
Security scanner declarations for bun install
interface Advisory
The result of a security scan of a package
- description: null | string
A brief description of the advisory, which Bun prints to the user.
nullif none is available. - level: 'warn' | 'fatal'
The severity of the advisory.
Bun always pretty-prints every advisory returned from the
scan()hook, then:- if any is fatal, Bun immediately cancels the installation and exits with a non-zero exit code
- otherwise, if any is warn, Bun asks whether to continue with the install when running in a TTY, and exits immediately when not
- url: null | string
A URL linking to a CVE or report where users can learn more about the advisory, or
nullif none is available.
interface Package
- requestedRange: string
The range the command requested, as written in
package.jsonor on the command line: a tag likebeta, a semver range like>=4.0.0, or a non-registry specifier likegithub:user/repoorfile:./pkg - tarball: string
The URL of the package tarball (
.tgz) Bun downloads, or the path of a local tarball.For
github:dependencies this is the GitHub API tarball URL for the resolved commit (honoringGITHUB_API_URL). Empty for packages that are not installed from a tarball, such asgit+dependencies and localfile:/link:directories. - version: string
What Bun resolved the requested range to, not a range itself.
For packages from a registry this is the exact semver version, like
4.1.2. For packages from other sources this is the resolved specifier as it appears inbun.lock, for examplegithub:user/repo#<commit>,git+https://host/repo.git#<commit>,https://example.com/pkg.tgz,./vendor/pkg.tgz,file:packages/pkgorlink:pkg. Compare it with Bun.semver.satisfies, which returnsfalsefor such specifiers, rather than assuming it parses as semver.The
user:password@part and the query string of a URL are left out of this field, of tarball and of requestedRange. The tarball of a package from a registry keeps its query string.