Documentation
¶
Overview ¶
Package javascript implements the JavaScript (and TypeScript) import extractor. The dispatcher in package depusage routes both Language values here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DepKey ¶
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 ¶
IsRelative reports whether the raw module string is a relative or absolute filesystem path. Used by the extractor to flag the extract.ImportRelative kind.
Types ¶
This section is empty.