Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

binode

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binode

Allows you to specify a --bin flag for node

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.3K
increased by24.06%
Maintainers
1
Weekly downloads
 
Created
Source

binode

Problem:

This is the problem we're solving:

You've got an npm package that exposes a CLI, we'll call it sndwch and accepts some args:

sndwch --topping ham --topping cheese

But then someone decides they want to run that with node's --inspect-brk flag (or maybe --require flag, or any other node-based flag). So they have to do this:

node --inspect-brk ./node_modules/.bin/sndwch --topping ham --topping cheese

The problem is that doesn't work on windows, so now you have to do this:

node --inspect-brk ./node_modules/sndwch/bin.js --topping ham --topping cheese

But now the location of your binary file in your package is part of the API and if you ever decide to change how that works it's technically a breaking change.

Solution:

People can install this package and then do this instead:

binode --inspect-brk -- sndwch --topping ham --topping cheese

Sometimes a package has a different binary name from the package name (like which calls it's binary node-which). There's no way to do a reverse-lookup of a binary to find the package for it, so you have to supply that by providing the package name along with the executable you want. Something like this:

binode --require ./mocks -- @remix-run/dev:remix dev

That's it..

Here's everything you need to know:

  • Everything on the left side of the -- is flags for node
  • The first thing after the -- is the binary you want to use
  • Everything after the binary you want to use is flags for that binary
  • If the package name and binary name are different, you must supply both after the -- by separating them by a : (for example: pkgName:binName).

Installation

npm install binode

License

MIT

FAQs

Package last updated on 23 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc