Skip to content
API Referencesecurity-archivebrowser

@vltpkg/security-archive/browser

Classes

SecurityArchive

Defined in: src/security-archive/src/browser.ts:67

A database of security information for given packages in a graph.

Extends

Implements

Constructors

new SecurityArchive()
new SecurityArchive(entries?): SecurityArchive

Defined in: node_modules/.vlt/npmtypescript@5.7.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:50

Parameters
entries?

null | readonly readonly [DepID, PackageReportData][]

Returns

SecurityArchive

Inherited from
Map<DepID, PackageReportData>.constructor
new SecurityArchive()
new SecurityArchive(iterable?): SecurityArchive

Defined in: node_modules/.vlt/npmtypescript@5.7.3/node_modules/typescript/lib/lib.es2015.collection.d.ts:49

Parameters
iterable?

null | Iterable<readonly [DepID, PackageReportData], any, any>

Returns

SecurityArchive

Inherited from
Map<DepID, PackageReportData>.constructor

Properties

ok
ok: boolean = false

Defined in: src/security-archive/src/browser.ts:74

Whether the security archive is valid.

Implementation of

SecurityArchiveLike.ok

Methods

delete()
delete(depId): boolean

Defined in: src/security-archive/src/browser.ts:101

Delete the report data stored under the base DepID.

Parameters
depId

DepID

Returns

boolean

Implementation of

SecurityArchiveLike.delete

Overrides
Map.delete
get()
get(depId): undefined | PackageReportData

Defined in: src/security-archive/src/browser.ts:79

Get the report data for a node, keyed by its base DepID.

Parameters
depId

DepID

Returns

undefined | PackageReportData

Implementation of

SecurityArchiveLike.get

Overrides
Map.get
has()
has(depId): boolean

Defined in: src/security-archive/src/browser.ts:86

Check for report data, keyed by the base DepID.

Parameters
depId

DepID

Returns

boolean

Implementation of

SecurityArchiveLike.has

Overrides
Map.has
set()
set(depId, data): this

Defined in: src/security-archive/src/browser.ts:94

Store report data for a node, keyed by its base DepID so peer-suffixed copies of the same package share one entry.

Parameters
depId

DepID

data

PackageReportData

Returns

this

Implementation of

SecurityArchiveLike.set

Overrides
Map.set
load()
static load(dump): undefined | SecurityArchive

Defined in: src/security-archive/src/browser.ts:108

Loads a security archive from a valid JSON dump.

Parameters
dump

unknown

Returns

undefined | SecurityArchive

Variables

npmRegistryURL

const npmRegistryURL: 'https://registry.npmjs.org/' =
'https://registry.npmjs.org/'

Defined in: src/security-archive/src/browser.ts:18

Functions

usesNpmRegistry()

function usesNpmRegistry(node): boolean

Defined in: src/security-archive/src/browser.ts:36

Socket.dev only has reports for the public npm ecosystem. Eligible when the node’s origin is https://registry.npmjs.org/ or the URL configured as registries.npm.

Parameters

node

NodeLike

Returns

boolean

References

asPackageReportData

Re-exports asPackageReportData

asSecurityArchiveLike

Re-exports asSecurityArchiveLike

isPackageReportData

Re-exports isPackageReportData

isSecurityArchiveLike

Re-exports isSecurityArchiveLike

PackageAlert

Re-exports PackageAlert

PackageAlertProps

Re-exports PackageAlertProps

PackageReportData

Re-exports PackageReportData

PackageScore

Re-exports PackageScore

SecurityArchiveLike

Re-exports SecurityArchiveLike

SecurityArchiveRefreshOptions

Re-exports SecurityArchiveRefreshOptions