autobin
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

autobin

npm typescript

Prepare bin scripts for publishing.

If I should maintain this repo, please ⭐️ GitHub stars

DM me on Twitter if you have questions or suggestions. Twitter Follow


About

Hashbang

Bin scripts require a hashbang to run properly:

#!/usr/bin/env node

However, if you're using TypeScript, you'll need to compile to JavaScript before publishing.

This package searches for each file in the bin field of your package.json, and prepends the Node shebang to the file if it doesn't already have one.

Executable Bits

Additionally, autobin sets the executable bits on the file. Although this is not required as package managers set the executable bits when installing, it allows you to run the script directly before publishing.

Installation

yarn add --dev autobin
npm install --save-dev autobin
pnpm add --save-dev autobin

Usage

Package Scripts

In your package.json file:

{
  "scripts": {
    "postbuild": "autobin"
  }
}

The "postbuild" script automatically runs after the "build" script is run.

Command Line

Alternatively, you can run autobin directly from the command line:

yarn autobin
npm run autobin
pnpm run autobin



Have fun! 🎉



Dependenciesdependencies

Dev Dependencies


License license

MIT - The MIT License


See Also

  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.

Package Sidebar

Install

npm i autobin

Weekly Downloads

57

Version

1.1.1

License

MIT

Unpacked Size

7.32 kB

Total Files

10

Last publish

Collaborators

  • bconnorwhite