js

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DepKey

func DepKey(raw string) string

DepKey normalizes a raw npm module string to a lockfile-key form.

"lodash"           -> "lodash"
"lodash/merge"     -> "lodash"
"@scope/pkg"       -> "@scope/pkg"
"@scope/pkg/sub"   -> "@scope/pkg"
"./foo"            -> ""    (relative)
"../foo"           -> ""    (relative)
"/abs/path"        -> ""    (absolute)
"node:fs"          -> ""    (node builtin)
""                 -> ""

Built-in modules (node:fs, node:path, etc.) and bare names that match the historic builtin list (fs, path, http, ...) are NOT stripped here — that's the consumer's job. depusage only refuses the patterns that can never be a registry dep: relative, absolute, and node: scheme.

func IsRelative

func IsRelative(raw string) bool

IsRelative reports whether the raw module string is a relative or absolute filesystem path. Used by the extractor to flag the [ImportRelative] kind.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL