项目作者: codesuki

项目描述 :
Adds the node_modules/.bin directory to the buffer exec_path. E.g. support project local eslint installations.
高级语言: Emacs Lisp
项目地址: git://github.com/codesuki/add-node-modules-path.git
创建时间: 2016-09-06T09:18:06Z
项目社区:https://github.com/codesuki/add-node-modules-path

开源协议:MIT License

下载


add-node-modules-path

MELPA

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.)

  1. (eval-after-load 'js-mode
  2. '(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:

  1. (use-package add-node-modules-path
  2. :custom
  3. (add-node-modules-path-command '("pnpm bin" "pnpm bin -w")))