Documentation
¶
Overview ¶
Package sniff detects the module format of a JavaScript file from its bytes. No JS parser; it strips string and comment content and looks for reserved-token signatures that survive minification. Best-effort.
Index ¶
Constants ¶
View Source
const ( ESM = "esm" UMD = "umd" IIFE = "iife" CJS = "cjs" AMD = "amd" SystemJS = "system" Unknown = "unknown" )
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format detects the module format. Order matters: UMD wrappers contain markers for several other formats, so UMD wins first.
func StripSourcemapURL ¶
StripSourcemapURL removes every sourceMappingURL directive, preserving surrounding newlines so stack traces stay aligned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.