brew tap Cur50r/homebrew-thirsty brew install thirsty-raspberry-imager
To create a brew formula for a Node.js script, you will need to create a new formula file in the Homebrew/homebrew-core repository. This file should contain the necessary instructions for Homebrew to install and manage the script.
To create a new formula file, follow these steps:
Fork the Homebrew/homebrew-core repository on GitHub. Clone your fork of the repository to your local machine. Create a new formula file in the Formula directory of your local repository. This file should have the .rb extension and should be named after your Node.js script, with any dashes or underscores replaced by dots (e.g. my-script.rb would be named my.script.rb). Open the formula file in a text editor and add the following template code: Copy code class MyScript < Formula desc "Description of my Node.js script" homepage "https://github.com/username/my-script" url "https://github.com/username/my-script/archive/v1.0.0.tar.gz" sha256 "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
depends_on "node"
def install system "npm", "install", Language::Node.std_npm_install_args(libexec) bin.install_symlink Dir["#{libexec}/bin/"] end
test do system "node", "-e", "console.log('hello')" end end Replace the placeholder values in the template code with the appropriate values for your script. For example, you should update the desc and homepage fields to provide a brief description and URL for your script, and you should update the url and sha256 fields to point to the latest version of your script on GitHub. Save the formula file and commit your changes to your local repository. Push your changes to your fork on GitHub and create a new pull request to merge them into the Homebrew/homebrew-core repository. Once your pull request is accepted and merged, your Node.js script will be available to install via Homebrew. To install it, users can run the following command:
Copy code brew install my-script They can then run the script by typing its name at the command prompt (e.g. my-script).
https://bharathvaj.me/blog/how-to-publish-your-nodejs-project-on-homebrew