A command-line utility for managing JavaScript import maps dependencies.
This utility uses the esm.sh CDN to fetch package information and versions.
To install im-cli globally, run the following command:
npm install -g im-cliim <command> [package-name] [@version]To add a package called lodash to your import map JSON file, run:
im add lodashTo add a specific version of the lodash package, include the version with the package name:
im add [email protected]To update the lodash package to the latest version, run:
im update lodashTo remove the lodash package from your import map JSON file, run:
im remove lodashTo display a help message with command usage, run:
im helpTo use the generated import map in your HTML file, include the following script tag:
<script type="importmap" src="path/to/your/im.json"></script>Now you can use the ES module imports in your JavaScript files:
import _ from "lodash"