https://github.com/zaboco/espm
A package manager for ES modules
https://github.com/zaboco/espm
Last synced: about 1 year ago
JSON representation
A package manager for ES modules
- Host: GitHub
- URL: https://github.com/zaboco/espm
- Owner: zaboco
- Created: 2022-06-01T12:33:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-02T12:20:56.000Z (about 4 years ago)
- Last Synced: 2025-03-09T18:18:16.950Z (over 1 year ago)
- Language: TypeScript
- Size: 283 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @zaboco/espm
A package manager for ES modules
| ⚠️ | **Experimental** | This package is an experiment. It is very limited for now, and have known issues. |
|:---:|:----------------:| :--- |
## Installation
It is recommended to install this tool globally
```shell
npm i -g @zaboco/espm
```
It can also be installed locally, of course:
```shell
npm i -D @zaboco/espm
```
> **Note**: If you do so, you will have to use `npx` to run the commands. E.g. `npx espm install react`.
## Usage
| ⚠️ | **WIP** | Only adding TS types is available for now |
|:---:| :---:|:--- |
### Adding TS types
You can add `.d.ts` files for packages, without installing them with `npm`. It fetches the files from [a CDN](https://esm.sh/). Also fetches imported types, recursively.
```shell
espm add [@version]
```
## Known issues
- Type reference paths are ignored `/// `. In this case `./foo.d.ts` is not downloaded from the CDN
- TS `namespace` syntax is not supported. For example, `espm add preact` would fail.
- Scoped packages do not work well. E.g. `espm add uvu/assert` will not work as intended.