{"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"keywords":["express","extension","open","file","editor"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"description":"Express extension to open file in editor","readme":"[![NPM version](https://img.shields.io/npm/v/express-open-in-editor.svg)](https://www.npmjs.com/package/express-open-in-editor)\n[![Dependency Status](https://img.shields.io/david/lahmatiy/express-open-in-editor.svg)](https://david-dm.org/lahmatiy/express-open-in-editor)\n\nExpress extension to open any file in an editor. Based on [open-in-editor](https://github.com/lahmatiy/open-in-editor).\n\n## Install\n\n```\nnpm install express-open-in-editor\n```\n\n## Usage\n\n```js\nvar express = require('express');\nvar openInEditor = require('express-open-in-editor');\n\nvar app = express();\n\napp.use(openInEditor());\n\n// ...\n```\n\nAfter that you can use GET requests like `/open-in-editor?file=foo/bar.ext:2:5` to open `foo/bar.ext` in an editor at line 2 column 5.\n\nBy default extension uses `process.env.VISUAL` or `process.env.EDITOR` (with this priority) to get the command to open file in an editor. It could be set globally or with main script:\n\n```\nEDITOR=subl node app.js\n```\n\nAlso you can set `process.env.OPEN_FILE` that has highest priority and understands shorthands (i.e. `subl` for `Sublime Text` or `atom` for `Atom Editor`).\n\nFor more details about editor setup see [open-in-editor](https://github.com/lahmatiy/open-in-editor).\n\n### Using with webpack-dev-server\n\nAlthough `webpack-dev-server` uses `express` to create server, you can't use `app.use()` to apply extension. Instead you should define it in `setup` method (see [issue](https://github.com/webpack/webpack-dev-server/issues/285) for details).\n\n```js\nvar server = new WebpackDevServer(webpack(config), {\n  // ...\n  setup: function(app) {\n    app.use(openInEditor());\n  }\n});\n```\n\n## API\n\n```\nopenInEditor([options]);\n```\n\n### options\n\n#### url\n\nType: `String`\n\nDefault: `/open-in-editor`\n\nRequest to this path triggers middleware.\n\n#### editor\n\nType: `String`\n\nValues: `sublime`, `atom`, `code`\n\nDefault: *not set*\n\nEditor to open files. Option accepts one of preset values. When value is set, extension tries to detect command to launch an editor.\n\nSupported editors:\n\n- `sublime` – Sublime Text\n- `atom` – Atom Editor\n- `code` – Visual Studio Code\n\n#### cmd\n\nType: `String`\n\nDefault: *not set*\n\nCommand to launch an editor. This option overrides whatever is set in `editor` option.\n\nCommand could contain placeholders that will be replaced with actual values. Supported placeholders: `filename`, `line` and `column`.\n\n```js\napp.use(openInEditor({\n  cmd: 'code -r -g {filename}:{line}:{column}'\n}));\n```\n\nIf no `{filename}` placeholder is present, then `{filename}:{line}:{column}` is appended to the value of this option. That way previous example could be simplified:\n\n```js\napp.use(openInEditor({\n  cmd: 'code -r -g'\n}));\n```\n\n## Related projects\n\n- [open-in-editor](https://github.com/lahmatiy/open-in-editor) – package that do the main task of `express-open-in-editor`, i.e. opens file in editor.\n- [babel-plugin-source-wrapper](https://github.com/restrry/babel-plugin-source-wrapper) – `Babel` plugin that instruments source code to associate objects with location they defined in code base.\n- [Component Inspector](https://github.com/lahmatiy/component-inspector) – developer tool to inspect components that can open component creation source location in editor. Has integrations for `React`, `Backbone` and can be adopter for other frameworks.\n\n## License\n\nMIT\n","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"license":"MIT","versions":{"1.0.0":{"name":"express-open-in-editor","version":"1.0.0","description":"Express extension to open file in editor","author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"keywords":["express","extension","open","file","editor"],"homepage":"https://github.com/lahmatiy/express-open-in-editor#readme","dependencies":{"open-in-editor":"github:lahmatiy/open-in-editor","parseurl":"~1.3.0"},"scripts":{},"gitHead":"bca536a7448010f0d9566b8fb014f7bd13348612","bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"_id":"express-open-in-editor@1.0.0","_shasum":"106717ea3376f1203dc9bbbcf584473556ddf710","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"lahmatiy","email":"rdvornov@gmail.com"},"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"dist":{"shasum":"106717ea3376f1203dc9bbbcf584473556ddf710","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/express-open-in-editor/-/express-open-in-editor-1.0.0.tgz"},"directories":{}},"1.1.0":{"name":"express-open-in-editor","version":"1.1.0","description":"Express extension to open file in editor","author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"keywords":["express","extension","open","file","editor"],"dependencies":{"open-in-editor":"^1.1.0","parseurl":"~1.3.0"},"scripts":{},"gitHead":"8931a92c50f42ad3b3c1b0b71c6e152c9bf8367f","bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"homepage":"https://github.com/lahmatiy/express-open-in-editor#readme","_id":"express-open-in-editor@1.1.0","_shasum":"079595ccf831ee21781e09dd11eafe43f247d571","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"lahmatiy","email":"rdvornov@gmail.com"},"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"dist":{"shasum":"079595ccf831ee21781e09dd11eafe43f247d571","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/express-open-in-editor/-/express-open-in-editor-1.1.0.tgz"},"directories":{}},"1.2.0":{"name":"express-open-in-editor","version":"1.2.0","description":"Express extension to open file in editor","author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"keywords":["express","extension","open","file","editor"],"dependencies":{"open-in-editor":"^1.2.0","parseurl":"~1.3.0"},"scripts":{},"gitHead":"2e711b9993ec8dbebc53663245d36eb5a2c50f82","bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"homepage":"https://github.com/lahmatiy/express-open-in-editor#readme","_id":"express-open-in-editor@1.2.0","_shasum":"d9dbc8ed98c8de300eaeaba19d42aeee2da127c3","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"lahmatiy","email":"rdvornov@gmail.com"},"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"dist":{"shasum":"d9dbc8ed98c8de300eaeaba19d42aeee2da127c3","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/express-open-in-editor/-/express-open-in-editor-1.2.0.tgz"},"directories":{}},"1.2.1":{"name":"express-open-in-editor","version":"1.2.1","description":"Express extension to open file in editor","author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"keywords":["express","extension","open","file","editor"],"dependencies":{"open-in-editor":"^1.2.0","parseurl":"~1.3.0"},"scripts":{},"gitHead":"8b9366076b551ec22f552e78f1cd3b198d6817b2","bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"homepage":"https://github.com/lahmatiy/express-open-in-editor#readme","_id":"express-open-in-editor@1.2.1","_shasum":"f99ff282feefa18c42a60028d9583f2e95d02048","_from":".","_npmVersion":"3.10.4","_nodeVersion":"6.2.1","_npmUser":{"name":"lahmatiy","email":"rdvornov@gmail.com"},"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"dist":{"shasum":"f99ff282feefa18c42a60028d9583f2e95d02048","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/express-open-in-editor/-/express-open-in-editor-1.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/express-open-in-editor-1.2.1.tgz_1473183626897_0.3639840374235064"},"directories":{}},"2.0.0":{"name":"express-open-in-editor","version":"2.0.0","description":"Express extension to open file in editor","author":{"name":"Roman Dvornov","email":"rdvornov@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/lahmatiy/express-open-in-editor.git"},"keywords":["express","extension","open","file","editor"],"dependencies":{"open-in-editor":"^2.0.0","parseurl":"~1.3.0"},"scripts":{},"gitHead":"c5f0579c6d148716dddeac7b0f2f62c05d315b47","bugs":{"url":"https://github.com/lahmatiy/express-open-in-editor/issues"},"homepage":"https://github.com/lahmatiy/express-open-in-editor#readme","_id":"express-open-in-editor@2.0.0","_shasum":"c7c3b90c6d1a156df0e572809726276f6872625e","_from":".","_npmVersion":"4.4.1","_nodeVersion":"6.8.1","_npmUser":{"name":"lahmatiy","email":"rdvornov@gmail.com"},"maintainers":[{"name":"lahmatiy","email":"rdvornov@gmail.com"}],"dist":{"shasum":"c7c3b90c6d1a156df0e572809726276f6872625e","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/express-open-in-editor/-/express-open-in-editor-2.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/express-open-in-editor-2.0.0.tgz_1490224497887_0.4049704058561474"},"directories":{}}},"name":"express-open-in-editor","time":{"modified":"2017-03-22T23:14:58.528Z","created":"2015-09-24T19:09:34.533Z","1.0.0":"2015-09-24T19:09:34.533Z","1.1.0":"2015-11-08T16:19:40.916Z","1.2.0":"2016-01-25T20:52:51.952Z","1.2.1":"2016-09-06T17:40:28.476Z","2.0.0":"2017-03-22T23:14:58.528Z"},"readmeFilename":"README.md","homepage":"https://github.com/lahmatiy/express-open-in-editor#readme"}