Skip to content

Commit 1b006ae

Browse files
authored
chore: add README (#134)
1 parent 383ef26 commit 1b006ae

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# launch-editor-middleware
2+
3+
An express/connect/webpack-dev-server compatible middleware for opening files in your editor from the browser, powered by [`launch-editor`](https://github.com/vitejs/launch-editor#readme).
4+
5+
## Usage
6+
7+
```js
8+
const launchMiddleware = require('launch-editor-middleware')
9+
10+
app.use('/__open-in-editor', launchMiddleware())
11+
```
12+
13+
To launch files, send requests to the server like the following:
14+
15+
```text
16+
/__open-in-editor?file=src/main.js:13:24
17+
```
18+
19+
Both the line and column numbers are optional. `file://` URIs are also supported.
20+
21+
## API
22+
23+
See [`index.d.ts`](./index.d.ts) for the full type definitions and the available arguments.
24+
25+
## Custom editor support
26+
27+
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](https://github.com/vitejs/launch-editor#custom-editor-support) for details.

‎packages/launch-editor/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

0 commit comments

Comments
 (0)