Registry / web-framework / launch-editor-middleware

launch-editor-middleware

JSON →
library2.13.2jsnpmunverified

Express middleware that opens files in the user's default editor when requested via a URL. Version 2.13.2 is current; it is part of the launch-editor ecosystem by Evan You. It relies on launch-editor to resolve the editor and is typically used in development tooling like Vue CLI or Vite to open source files directly from the browser console. No active development fork, but stable and widely used. Differentiator: simple integration with Express, zero-config editor detection.

npm install launch-editor-middleware
INSTALL
IMPORT
SIG · LAUNCH-EDITOR-MIDD
L
launch-editor-middleware
web-frameworkjavascriptv2.13.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import launchEditorMiddleware from 'launch-editor-middleware'
const launchEditorMiddleware = require('launch-editor-middleware')
ESM default export; CJS via require works with default export
launchEditorMiddleware
const { launchEditorMiddleware } = require('launch-editor-middleware')
const launchEditorMiddleware = require('launch-editor-middleware').default
CJS named export also available; prefer ESM when possible

Shows how to mount the middleware on an Express app to open files via /__open-in-editor?file=path.

import express from 'express'; import launchEditorMiddleware from 'launch-editor-middleware'; const app = express(); app.use('/__open-in-editor', launchEditorMiddleware()); app.listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
breakingIn version 2.x, the middleware signature changed from `app.use('/__open-in-editor', launchEditorMiddleware)` to `app.use('/__open-in-editor', launchEditorMiddleware())`.
fix
Call the function: `app.use('/__open-in-editor', launchEditorMiddleware())`.
affects: >=2.0.0 <2.0.0
gotchaThe middleware only works in development environments; production builds should not include it.
fix
Conditionally apply the middleware only when `NODE_ENV` is not `'production'`.
affects: all
deprecatedThe `default` import is the same as the named import; both are valid.
fix
Use either import style consistently.
affects: all
Errors
Common errors & fixes
Cannot find module 'launch-editor-middleware'
Package not installed.
fix
Run `npm install launch-editor-middleware --save-dev`.
TypeError: launchEditorMiddleware is not a function
Missing function call parentheses.
fix
Change `app.use('/__open-in-editor', launchEditorMiddleware)` to `app.use('/__open-in-editor', launchEditorMiddleware())`.
Upgrade
Version history
2.13.2latest on npm
Audit
Dependencies
launch-editorrequiredcore dependency for editor detection and launching
expressrequiredpeer dependency; requires Express app instance
Agent activity
4 hits · last 30 days
node
4
Resources
launch-editor-middleware — npm install launch-editor-middleware · libregistry