npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

launch-editor-middleware

2.14.1

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:45211
$ npm install launch-editor-middleware
DailyWeeklyMonthlyYearly

launch-editor-middleware

An express/connect/webpack-dev-server compatible middleware for opening files in your editor from the browser, powered by launch-editor.

Usage

const launchMiddleware = require('launch-editor-middleware')

app.use('/__open-in-editor', launchMiddleware())

To launch files, send requests to the server like the following:

/__open-in-editor?file=src/main.js:13:24

Both the line and column numbers are optional. file:// URIs are also supported.

API

See index.d.ts for the full type definitions and the available arguments.

Custom editor support

This package infers the editor from currently running processes. You can override that behavior with the LAUNCH_EDITOR environment variable to force a specific editor or run a custom launch script. See the launch-editor README for details.