importly is a command-line utility that generates import maps.
so your apps can load es module packages without a bundler.
works nicely with es-module-shims.
npx importly < package-lock.json > importmap.json
--host=node_modules
specify where the import map points to.
where the dependencies will be loaded from.
--host=node_modules (default) β point to your node_modules directory--host=unpkg β point to the unpkg cdn--host=jsdelivr β point to the jsdelivr cdn--dev
include your package's devDependencies.
--lookup=node_modules
tell importly where to seek information about packages.
it needs to inspect each package json.
--lookup=node_modules (default) β look in your local node_modules directory--lookup=unpkg β query the unpkg cdn--lookup=jsdelivr β query the jsdelivr cdn--root=/
the url prefix that leads to your node_modules directory.
this affects where the importmap is pointing to.
only applies when --host=node_modules.
--root=/ (default) β find node_modules at your server root--root="" β find node_modules in the current directory--root=/my/special/path/ β find node_modules at /my/special/path/node_modules--semver=exact
the semver prefix to use on the import map versions.
only applies when pointing to a cloud cdn.
--semver=exact or --semver="" (default) no prefix, use pinned versions--semver=major or --semver=^ pin major version, with caret prefix--semver=minor or --semver=~ pin minor version, with tilde prefix--mini
minify importmap output.
eliminates whitespace.
you don't have to use a package-lock.json
package.json will work.dependencies will work.package-lock.json is better because it includes subdependencies (and they're scoped, which means your dependencies can use different versions of a single subdependency)scoped subdependencies only work when
package-lock.json--host=node_modulesworks offline when
--host=node_modules--lookup=node_modulesTypeScript
92.2%
JavaScript
5.1%
HTML
2.7%
importly is a command-line utility that generates import maps.
so your apps can load es module packages without a bundler.
works nicely with es-module-shims.
npx importly < package-lock.json > importmap.json
--host=node_modules
specify where the import map points to.
where the dependencies will be loaded from.
--host=node_modules (default) β point to your node_modules directory--host=unpkg β point to the unpkg cdn--host=jsdelivr β point to the jsdelivr cdn--dev
include your package's devDependencies.
--lookup=node_modules
tell importly where to seek information about packages.
it needs to inspect each package json.
--lookup=node_modules (default) β look in your local node_modules directory--lookup=unpkg β query the unpkg cdn--lookup=jsdelivr β query the jsdelivr cdn--root=/
the url prefix that leads to your node_modules directory.
this affects where the importmap is pointing to.
only applies when --host=node_modules.
--root=/ (default) β find node_modules at your server root--root="" β find node_modules in the current directory--root=/my/special/path/ β find node_modules at /my/special/path/node_modules--semver=exact
the semver prefix to use on the import map versions.
only applies when pointing to a cloud cdn.
--semver=exact or --semver="" (default) no prefix, use pinned versions--semver=major or --semver=^ pin major version, with caret prefix--semver=minor or --semver=~ pin minor version, with tilde prefix--mini
minify importmap output.
eliminates whitespace.
you don't have to use a package-lock.json
package.json will work.dependencies will work.package-lock.json is better because it includes subdependencies (and they're scoped, which means your dependencies can use different versions of a single subdependency)scoped subdependencies only work when
package-lock.json--host=node_modulesworks offline when
--host=node_modules--lookup=node_modulesTypeScript
92.2%
JavaScript
5.1%
HTML
2.7%