# node-r_esm

> Little wrapper script to allow running your .mjs file via its shebang

Latest version **0.1.0** (published 2018-04-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-r_esm
pnpm add node-r_esm
yarn add node-r_esm
bun add node-r_esm
```

Provides the command `node-r_esm`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-04-15 |
| First published | 2018-04-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | M.K. |
| Maintainers | mk-pmb |
| Keywords | esm, shebang |

## Links

- npm: https://www.npmjs.com/package/node-r_esm
- Repository: https://github.com/mk-pmb/node-r_esm
- Homepage: https://github.com/mk-pmb/node-r_esm/#readme
- Issues: https://github.com/mk-pmb/node-r_esm/issues
- npm.io page: https://npm.io/package/node-r_esm

## Recent versions

- 0.1.0 (latest) — 2018-04-15

## README

<!--#echo json="package.json" key="name" underline="=" -->
node-r_esm
==========
<!--/#echo -->

<!--#echo json="package.json" key="description" -->
Little wrapper script to allow running your .mjs file via its shebang
<!--/#echo -->


The ["esm" module](https://github.com/standard-things/esm/) has the nice
invocation method of running an ES module file like this:

```bash
$ nodejs -r esm test/nospace.mjs
util.promisify? function
```

However, if you try to use that in a shebang line, you'll get an error like

```bash
$ ./test/nospace.mjs
/usr/bin/env: node -r esm: No such file or directory
```

… because the you can only pass one arg after the program name.

This package contains a small bash script that inserts the `-r esm`
options, so you can write your shebang like this:

```bash
#!/usr/bin/env node-r_esm
```

and this run your module like this:

```bash
$ ./test/shebang.mjs
util.promisify? function
```



Caveats
-------

* This module doesn't (yet) care about whether the `esm` module is
  installed, or where. Your package will probably have to declare it
  as a dependency. The version used, and whether nodejs will find it,
  might even depend on the current working directory from which the
  shebang file is invoked.





&nbsp;


License
-------
<!--#echo json="package.json" key=".license" -->
ISC
<!--/#echo -->

---
_Source: https://npm.io/package/node-r_esm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
