![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
express-open-in-editor
Advanced tools
Express extension to open file in editor. Based on open-in-editor.
npm install express-open-in-editor
var express = require('express');
var openInEditor = require('express-open-in-editor');
var app = express();
app.use(openInEditor());
// ...
After that you can use GET requests like /open-in-editor?file=foo/bar.ext:2:5
to open foo/bar.ext
in editor at line 2 column 5.
By default extension uses process.env.VISUAL
or process.env.EDITOR
(with this priority) to get command to open file in editor. It could be set globally or with main script:
EDITOR=subl node app.js
Also you can set process.env.OPEN_FILE
, that has highest priority and could detect editor command to launch by it's short name (i.e. subl
for Sublime Text
or atom
for Atom Editor
).
More details about editor setup see in open-in-editor.
openInEditor([options]);
Type: String
Default: /open-in-editor
Listen path.
Type: String
Values: sublime
, atom
, code
Default: not set
Allows set editor to open file. Option accepts one of preset value. When some value is set, extension try to detect command to launch editor if possible.
Supported editors:
sublime
– Sublime Textatom
– Atom Editorcode
– Visual Studio CodeType: String
Default: not set
Specify command to launch editor. If some value set to option then editor
is ignoring.
Command could contains some patterns to be replaced by actual values. Supported values: filename
, line
and column
.
app.use(openInEditor({
cmd: 'code -r -g {filename}:{line}:{column}'
}));
If no {filename}
pattern in command found then {filename}:{line}:{column}
is appending. So, previous example could be simplified:
app.use(openInEditor({
cmd: 'code -r -g'
}));
MIT
FAQs
Express middleware to open file in editor
The npm package express-open-in-editor receives a total of 30 weekly downloads. As such, express-open-in-editor popularity was classified as not popular.
We found that express-open-in-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.