Giter Club home page Giter Club logo

zsh-node-bin's Introduction

Zsh node-bin

Add node_modules/.bin directories to your $PATH.

Installation

Oh My Zsh

Clone the repository into your OMZ custom directory.

git clone https://github.com/remcohaszing/zsh-node-bin.git "${ZSH:-~/.oh-my-zsh}/custom/plugins/node-bin"

In your .zshrc file, add node-bin to the plugins array,

plugins+=(node-bin)

Without Oh My Zsh

Clone the repository somewhere.

git clone https://github.com/remcohaszing/zsh-node-bin.git ~/.local/share/zsh-node-bin

Source node-bin.plugin.zsh in your .zshrc

source ~/.local/share/zsh-node-bin/node-bin.plugin.zsh

Usage

This plugin runs a function before each command. This function searches for all node_modules/.bin directories up the file tree and adds them to your $PATH. This allows you to run these commands without the use of npx, pnpx, or bunx. This also works for subdirectories in your project and monorepos.

For example, without this plugin, you would run:

npx eslint .
pnpx prettier .
yarn remark .
bunx vitest

Now you can now run:

eslint .
prettier .
remark .
vitest

This plugin removes the overhead of those command runners, It also means those commands work with other integrations, such as autocompletion and thefuck.

Security

This plugin appends the paths. This means commands from node_modules/.bin can never override your system commands.

License

MIT © Remco Haszing

zsh-node-bin's People

Contributors

remcohaszing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.