Reference

CLI reference

Every bin/importmap command, its options, and its exit status.

Commands#

CommandWhat it doesDocs
pin [PACKAGES]Resolves each package on a CDN, downloads it to vendor/javascript (or pins the URL with --remote) and writes the pin.Pinning
unpin [PACKAGES]Removes the pin and the vendored file.Pinning
lock [PACKAGES]Marks the pins as locked at their current version. No network.Locking
unlock [PACKAGES]Removes the lock marker. No network.Locking
update [PACKAGES]Re-pins the outdated packages: the named ones, or every one.Updating
outdatedLists packages the registry has a newer version of.Updating
auditLists known vulnerabilities for the pinned versions.Updating
pristineRedownloads every vendored package at its pinned version.Updating
packagesPrints every package with a version, one per line.Updating
jsonBoots the app and prints the resolved import map as JSON.Updating

A package spec is name[@version][/subpath]: react, luxon@3, [email protected], apexcharts/core, @hotwired/stimulus@3. lock and unlock take names only.

pin options#

OptionTypeDefaultDescription
--from CDNStringthe pin's CDN, else jspmjspm, unpkg, jsdelivr, esm.sh, skypack or esm.run. Also moves a remote pin to that CDN.
--remoteBooleanfalsePin the resolved URL instead of vendoring a download; converts a vendored pin.
--minify / --no-minifyBooleanwhat the pin saysRun the download through bun, esbuild or terser. Recorded on the pin.
--lock / --no-lockBooleanwhat the pin saysLock the named packages at this version, or drop their lock. Dependencies are never locked.
--forceBooleanfalseRe-pin locked packages, keeping each lock at the new version.
--preload VALUEString, repeatablethe pin's preloadtrue, false, or an entry point name; repeat for several entry points.
--env ENVStringproductionThe jspm environment condition (production or development).

update options#

OptionTypeDefaultDescription
--allBooleanfalseUpdate every outdated package — what a bare update does; rejected together with names.
--forceBooleanfalseUpdate locked packages too, keeping each lock at the new version.

pristine options#

OptionTypeDefaultDescription
--from CDNStringeach pin's CDNRedownload everything from this CDN and record it on each pin.
--minify / --no-minifyBooleanwhat each pin saysMinify every download, or none, and record it.
--env ENVStringproductionThe jspm environment condition.

Exit status#

CommandExits 1 when
outdatedan unlocked package is outdated
audita vulnerability is known for a pinned version
updatea named package has no pin, or names are combined with --all; nothing is updated in either case
lock / unlocka named package has no pin, has no version to lock at, or was given with a version
anya CDN or registry request fails after three attempts; the message names the URL