
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
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 13 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.