Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fnm.el - Emacs integration for Fast Node Manager

Introduction

fnm.el configures Emacs to use Node.js installations managed by Fast Node Manager (FNM). It updates PATH, exec-path, and NODE_PATH without evaluating shell output.

Version resolution is delegated to fnm exec. FNM recursively resolves .nvmrc, .node-version, and package.json#engines.node, then falls back to its default alias.

Requirements

  • Emacs 28.1 or later
  • A current fnm release with exec and --resolve-engines, available on exec-path

The package has no third-party Emacs Lisp dependencies.

Installation

With use-package and straight.el

(use-package fnm
  :straight (:host github :repo "bobrowadam/fnm.el"))

Using package.el

The package is not currently available from MELPA.

Usage

Select the project or default version

M-x fnm-use asks FNM to resolve the current directory and falls back to its default alias.

(fnm-use)

Pass any selector accepted by FNM to select it explicitly:

(fnm-use "20")
(fnm-use "lts-latest")

M-x fnm-use-version provides completion over installed semantic versions.

Switch automatically

Enable the global minor mode to ask FNM to resolve Node when opening files in a different directory:

(fnm-auto-use-mode 1)

Disable it with (fnm-auto-use-mode -1). Run M-x fnm-use after changing a version file in the current directory.

Configuration

Set fnm-executable when fnm is not discoverable on exec-path.

Development

Run the ERT suite with:

emacs -Q --batch -L . -l fnm-test.el -f ert-run-tests-batch-and-exit

Contributing

Contributions to fnm.el are welcome.

About

Emacs FNM package

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages