# rollup-plugin-preserve-shebangs

> > A Rollup plugin that preserves shebangs (#!/usr/bin/env node) in output files

Latest version **0.2.0** (published 2020-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-preserve-shebangs
pnpm add rollup-plugin-preserve-shebangs
yarn add rollup-plugin-preserve-shebangs
bun add rollup-plugin-preserve-shebangs
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-03-23 |
| First published | 2019-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Elad Ossadon |
| Maintainers | elado |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-preserve-shebangs
- Repository: https://github.com/elado/rollup-plugin-preserve-shebangs
- Issues: https://github.com/elado/rollup-plugin-preserve-shebangs/issues
- npm.io page: https://npm.io/package/rollup-plugin-preserve-shebangs

## Dependencies (1)

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

## Recent versions

- 0.2.0 (latest) — 2020-03-23
- 0.1.2 — 2019-10-22
- 0.1.1 — 2019-10-22
- 0.1.0 — 2019-10-22

## README

# rollup-plugin-preserve-shebangs

> A Rollup plugin that preserves shebangs (#!/usr/bin/env node) in output files

## Why?

Package executables (under `bin` in package.json) need _shebang_ `#!/usr/bin/env node` at the top of the file.

With that line, rollup errors:

```
Error: Unexpected character '#'
```

This plugin removes the shebang before compilation, and restores it before writing the file.

## Install

```
npm i -D rollup-plugin-preserve-shebangs
# or, with yarn
yarn add -D rollup-plugin-preserve-shebangs
```

## Usage

```js
// rollup.config.js

const { preserveShebangs } = require('rollup-plugin-preserve-shebangs');

module.exports = {
  // ...
  plugins: [
    // ...
    preserveShebangs(),
  ],
};
```

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