# rollup-plugin-hashbang

> Preserve hashbang and make output file executable.

Latest version **3.0.0** (published 2022-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-hashbang
pnpm add rollup-plugin-hashbang
yarn add rollup-plugin-hashbang
bun add rollup-plugin-hashbang
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-01-10 |
| First published | 2017-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | egoist |
| Maintainers | egoist, rem |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-hashbang
- Repository: https://github.com/egoist/rollup-plugin-hashbang
- Homepage: https://github.com/egoist/rollup-plugin-hashbang#readme
- Issues: https://github.com/egoist/rollup-plugin-hashbang/issues
- npm.io page: https://npm.io/package/rollup-plugin-hashbang

## Dependencies (1)

- [magic-string](https://npm.io/package/magic-string.md) ^0.25.7

## Recent versions

- 3.0.0 (latest) — 2022-01-10
- 2.2.2 — 2019-01-31
- 2.2.1 — 2019-01-25
- 2.2.0 — 2019-01-25
- 2.0.0 — 2019-01-23
- 1.0.1 — 2017-12-26
- 1.0.0 — 2017-12-26

## README

# rollup-plugin-hashbang

[![NPM version](https://img.shields.io/npm/v/rollup-plugin-hashbang.svg?style=flat)](https://npmjs.com/package/rollup-plugin-hashbang) [![NPM downloads](https://img.shields.io/npm/dm/rollup-plugin-hashbang.svg?style=flat)](https://npmjs.com/package/rollup-plugin-hashbang)

## Install

```bash
npm i rollup-plugin-hashbang -D
```

## Usage

With `rollup.config.js`:

```js
import hashbang from "rollup-plugin-hashbang";

export default {
  plugins: [hashbang()],
};
```

In:

```js
#!/usr/bin/env node

console.log("hi");
```

Output:

```js
#!/usr/bin/env node
"use strict";

console.log("hi");
```

Hashbang is preserved and the output file will be executable you don't need to `chmod +x FILE` to run it.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## Author

**rollup-plugin-hashbang** © [EGOIST](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/rollup-plugin-hashbang/contributors)).

> [egoist.moe](https://egoist.moe) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@\_egoistlily](https://twitter.com/_egoistlily)

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