Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codesuki/add-node-modules-path
Adds the node_modules/.bin directory to the buffer exec_path. E.g. support project local eslint installations.
https://github.com/codesuki/add-node-modules-path
emacs exec-path node node-modules path
Last synced: 3 months ago
JSON representation
Adds the node_modules/.bin directory to the buffer exec_path. E.g. support project local eslint installations.
- Host: GitHub
- URL: https://github.com/codesuki/add-node-modules-path
- Owner: codesuki
- License: mit
- Created: 2016-09-06T09:18:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T06:55:06.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T05:35:10.364Z (3 months ago)
- Topics: emacs, exec-path, node, node-modules, path
- Language: Emacs Lisp
- Size: 13.7 KB
- Stars: 145
- Watchers: 2
- Forks: 17
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# add-node-modules-path
[![MELPA](http://melpa.org/packages/add-node-modules-path-badge.svg)](http://melpa.org/#/add-node-modules-path)
This file provides `add-node-modules-path`, which searches
the current files parent directories for the `node_modules/.bin/` directory
and adds it to the buffer local `exec-path`.
This allows Emacs to find project based installs of e.g. eslint.## Usage
`M-x add-node-modules-path`To automatically run it when opening a new buffer:
(Choose depending on your favorite mode.)```
(eval-after-load 'js-mode
'(add-hook 'js-mode-hook #'add-node-modules-path))
```## Monorepo Support
In a monorepo scenario it might make sense to add multiple directories.
To achieve this, additional commands can be specified:```
(use-package add-node-modules-path
:custom
(add-node-modules-path-command '("pnpm bin" "pnpm bin -w")))
```