https://github.com/obetomuniz/im-cli
A command line tool for web developers manage Import Maps dependencies
https://github.com/obetomuniz/im-cli
cli importmaps nodejs package-manager typescript
Last synced: about 1 month ago
JSON representation
A command line tool for web developers manage Import Maps dependencies
- Host: GitHub
- URL: https://github.com/obetomuniz/im-cli
- Owner: obetomuniz
- License: other
- Created: 2023-04-01T03:55:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T04:21:46.000Z (about 2 years ago)
- Last Synced: 2025-04-01T13:01:37.239Z (about 1 month ago)
- Topics: cli, importmaps, nodejs, package-manager, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/im-cli
- Size: 126 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Import Maps Command Line Interface
A command-line utility for managing [JavaScript import maps](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) dependencies.
This utility uses the [esm.sh](https://esm.sh) CDN to fetch package information and versions.
## Installation
To install `im-cli` globally, run the following command:
```bash
npm install -g im-cli
```## Usage
```bash
im [package-name] [@version]
```## Commands
### Adding a package
To add a package called `lodash` to your import map JSON file, run:
```bash
im add lodash
```To add a specific version of the `lodash` package, include the version with the package name:
```bash
im add [email protected]
```### Updating a package
To update the `lodash` package to the latest version, run:
```bash
im update lodash
```### Removing a package
To remove the `lodash` package from your import map JSON file, run:
```bash
im remove lodash
```### Displaying help
To display a help message with command usage, run:
```bash
im help
```## Import map usage in HTML
To use the generated import map in your HTML file, include the following script tag:
```html
```
Now you can use the ES module imports in your JavaScript files:
```javascript
import _ from "lodash"
```