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-middlewareVerified import paths — ran on the pinned version, not inferred.
Shows how to mount the middleware on an Express app to open files via /__open-in-editor?file=path.
Call the function: `app.use('/__open-in-editor', launchEditorMiddleware())`.Conditionally apply the middleware only when `NODE_ENV` is not `'production'`.
Use either import style consistently.
Run `npm install launch-editor-middleware --save-dev`.
Change `app.use('/__open-in-editor', launchEditorMiddleware)` to `app.use('/__open-in-editor', launchEditorMiddleware())`.