1. rollup-plugin-hashbang
Preserve hashbang and make output file executable.
rollup-plugin-hashbang
Package: rollup-plugin-hashbang
Created by: egoist
Last modified: Mon, 16 May 2022 04:24:24 GMT
Version: 3.0.0
License: MIT
Downloads: 10,147
Repository: https://github.com/egoist/rollup-plugin-hashbang

Install

npm install rollup-plugin-hashbang
yarn add rollup-plugin-hashbang

rollup-plugin-hashbang

NPM version NPM downloads

Install

 npm i rollup-plugin-hashbang -D

Usage

With rollup.config.js:

 import hashbang from "rollup-plugin-hashbang";

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

In:

 #!/usr/bin/env node

console.log("hi");

Output:

 #!/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, Released under the MIT License.

Authored and maintained by EGOIST with help from contributors (list).

egoist.moe · GitHub @EGOIST · Twitter @_egoistlily

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code