Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autosseyai/autobin
Prepare bin scripts for publishing.
https://github.com/autosseyai/autobin
auto bin binary build node npm package typescript
Last synced: about 1 month ago
JSON representation
Prepare bin scripts for publishing.
- Host: GitHub
- URL: https://github.com/autosseyai/autobin
- Owner: AutosseyAI
- Created: 2023-01-02T15:08:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-28T15:34:17.000Z (over 1 year ago)
- Last Synced: 2024-11-10T04:16:43.581Z (about 2 months ago)
- Topics: auto, bin, binary, build, node, npm, package, typescript
- Language: TypeScript
- Homepage:
- Size: 42 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Prepare bin scripts for publishing._If you find this repo useful, stars are appreciated ⭐️_
_DM me on [Twitter](https://twitter.com/bconnorwhite) if you have questions or suggestions._
---
## About
### Hashbang
Bin scripts require a hashbang to run properly:
```js
#!/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
```sh
yarn add --dev autobin
``````sh
npm install --save-dev autobin
``````sh
pnpm add --save-dev autobin
```## Usage
### Package Scripts
In your `package.json` file:
```json
{
"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:
```sh
yarn autobin
``````sh
npm run autobin
``````sh
pnpm run autobin
```
---
Have fun! 🎉
---
Dependencies
- [@bconnorwhite/package](https://www.npmjs.com/package/@bconnorwhite/package): A utility for reading package.json of a project, and forming paths relative to it.
- [clee](https://www.npmjs.com/package/clee): Create CLI applications with glee 🎉
- [make-executable](https://www.npmjs.com/package/make-executable): Set the executable bits on a file
- [read-file-safe](https://www.npmjs.com/package/read-file-safe): Read files without try catch
- [write-file-safe](https://www.npmjs.com/package/write-file-safe): Write files atomically and create parent directories if necessaryDev Dependencies
- [@autossey/eslint-config](https://www.npmjs.com/package/@autossey/eslint-config): A base for projects that use ESLint.
- [@autossey/tsconfig](https://www.npmjs.com/package/@autossey/tsconfig): A collection of base TSConfigs for various types of projects.
- [npm-package-json-lint-config-auto](https://www.npmjs.com/package/npm-package-json-lint-config-auto): NPM Package.json Lint Config
License
[MIT](https://opensource.org/licenses/MIT) - _The MIT License_
See Also
- [autorepo](https://www.npmjs.com/package/autorepo): Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.