gamekaiju / script-executable-publishable

Template to publish an executable script to NPM without a bundler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

script-executable-publishable

Template that you can use to create an executable script, ready to be published in NPM. It does not use any bundler.

If you are wondering whether or not you need a bundler for your purposes, you can read this answer on stackoverflow and maybe this blog article.

script-executable-publishable

How to use

The procedure is fairly simple.

  1. Use this project as a template.
  2. Refill every occurrence of 'script-executable-publishable' inside package.json with your own project name. Replace 'description', 'keys' and 'author' with your own values and clear the readme: cat /dev/null > README.md. Update the license.
  3. Copy the example npmrc file as '.npmrc': cp .npmrc.example .npmrc and replace the placeholder with a Personal Access Token created with 'write:packages' as scope.
  4. Do pnpm install. If you don't have pnpm yet, follow this guide.
  5. To test if your script works as intended before publishing, use npm as explained here to avoid headaches.
  6. When you're ready to publish, do pnpm publish.

About

Template to publish an executable script to NPM without a bundler.

License:MIT License


Languages

Language:Shell 60.0%Language:JavaScript 40.0%