{"_id":"@umijs/launch-editor","_rev":"2835053","name":"@umijs/launch-editor","description":"launch your code editor using Node.js.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"chenshuai2144","email":""},{"name":"kuitos","email":""},{"name":"peachscript","email":""},{"name":"sorrycc","email":""},{"name":"xiaohuoni","email":""},{"name":"xierenyuan","email":""},{"name":"xusd320","email":""},{"name":"yifankakaxi","email":""},{"name":"zoomdong07","email":""}],"time":{"modified":"2022-09-06T15:32:33.000Z","created":"2019-09-05T04:15:48.584Z","1.0.1":"2019-10-16T01:36:27.241Z","1.0.0":"2019-09-27T04:36:27.126Z","1.0.0-beta.1":"2019-09-05T04:15:48.584Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/umijs/launch-editor.git"},"versions":{"1.0.1":{"name":"@umijs/launch-editor","version":"1.0.1","description":"launch your code editor using Node.js.","main":"lib/index.js","scripts":{"dev":"npm run build && node test/test.js","prepublishOnly":"npm run build && npm run test && np --no-cleanup --yolo --no-publish","coveralls":"cat ./coverage/lcov.info | coveralls","build":"tsc","test":"umi-test --coverage"},"repository":{"type":"git","url":"git+https://github.com/umijs/launch-editor.git"},"keywords":["editor","launch","nodejs"],"authors":{"name":"ycjcl868","email":"45808948@qq.com"},"bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"homepage":"https://github.com/umijs/launch-editor#readme","devDependencies":{"@types/chalk":"^2.2.0","@types/jest":"^24.0.18","@types/node":"^12.7.3","@umijs/fabric":"^1.1.10","concurrently":"^4.1.2","coverage":"^0.4.0","nodemon":"^1.19.2","np":"^5.0.1","typescript":"^3.6.2","umi-test":"^1.7.1"},"license":"MIT","publishConfig":{"access":"public"},"dependencies":{"cross-spawn":"^7.0.0","debug":"^4.1.1","user-home":"^2.0.0"},"gitHead":"bc7587a8bb91ddee424d3025b4f1362ee64e31bf","_id":"@umijs/launch-editor@1.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"602c2a1210bb0417470c575d19cd184cbbae3255","size":10883,"noattachment":false,"key":"/@umijs/launch-editor/-/@umijs/launch-editor-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@umijs/launch-editor/download/@umijs/launch-editor-1.0.1.tgz"},"maintainers":[{"name":"chenshuai2144","email":""},{"name":"kuitos","email":""},{"name":"peachscript","email":""},{"name":"sorrycc","email":""},{"name":"xiaohuoni","email":""},{"name":"xierenyuan","email":""},{"name":"xusd320","email":""},{"name":"yifankakaxi","email":""},{"name":"zoomdong07","email":""}],"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/launch-editor_1.0.1_1571189787085_0.5047092185566282"},"_hasShrinkwrap":false,"publish_time":1571189787241,"_cnpm_publish_time":1571189787241,"_cnpmcore_publish_time":"2021-12-16T14:02:00.175Z"},"1.0.0":{"name":"@umijs/launch-editor","version":"1.0.0","description":"launch your code editor using Node.js.","main":"lib/index.js","scripts":{"dev":"npm run build && node test/test.js","prepublishOnly":"npm run build && npm run test","coveralls":"cat ./coverage/lcov.info | coveralls","build":"tsc","test":"umi-test --coverage"},"repository":{"type":"git","url":"git+https://github.com/umijs/launch-editor.git"},"keywords":["editor","launch","nodejs"],"authors":{"name":"ycjcl868","email":"45808948@qq.com"},"bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"homepage":"https://github.com/umijs/launch-editor#readme","devDependencies":{"@types/jest":"^24.0.18","@types/node":"^12.7.3","@umijs/fabric":"^1.1.10","concurrently":"^4.1.2","coverage":"^0.4.0","nodemon":"^1.19.2","typescript":"^3.6.2","umi-test":"^1.7.1"},"license":"MIT","publishConfig":{"access":"public"},"dependencies":{"@types/chalk":"^2.2.0","cross-spawn":"^7.0.0","debug":"^4.1.1","user-home":"^2.0.0"},"gitHead":"394038072f2732ec043ea071864d0d119e7f5626","_id":"@umijs/launch-editor@1.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"90cf02752c00c93107767ef26aae32aa5a107015","size":10700,"noattachment":false,"key":"/@umijs/launch-editor/-/@umijs/launch-editor-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@umijs/launch-editor/download/@umijs/launch-editor-1.0.0.tgz"},"maintainers":[{"name":"chenshuai2144","email":""},{"name":"kuitos","email":""},{"name":"peachscript","email":""},{"name":"sorrycc","email":""},{"name":"xiaohuoni","email":""},{"name":"xierenyuan","email":""},{"name":"xusd320","email":""},{"name":"yifankakaxi","email":""},{"name":"zoomdong07","email":""}],"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/launch-editor_1.0.0_1569558986978_0.8162817286850259"},"_hasShrinkwrap":false,"publish_time":1569558987126,"_cnpm_publish_time":1569558987126,"_cnpmcore_publish_time":"2021-12-16T14:02:00.885Z"},"1.0.0-beta.1":{"name":"@umijs/launch-editor","version":"1.0.0-beta.1","description":"launch your code editor using Node.js.","main":"lib/index.js","scripts":{"dev":"npm run build && node test/test.js","prepublishOnly":"npm run build && npm run test","coveralls":"cat ./coverage/lcov.info | coveralls","build":"tsc","test":"umi-test --coverage"},"repository":{"type":"git","url":"git+https://github.com/umijs/launch-editor.git"},"keywords":["editor","launch","nodejs"],"authors":{"name":"ycjcl868","email":"45808948@qq.com"},"bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"homepage":"https://github.com/umijs/launch-editor#readme","devDependencies":{"@types/jest":"^24.0.18","@types/node":"^12.7.3","@umijs/fabric":"^1.1.10","concurrently":"^4.1.2","coverage":"^0.4.0","nodemon":"^1.19.2","typescript":"^3.6.2","umi-test":"^1.7.1"},"license":"MIT","publishConfig":{"access":"public"},"dependencies":{"@types/chalk":"^2.2.0","cross-spawn":"^7.0.0"},"gitHead":"1371476066050430bd5d24d02e48db96b03feca7","_id":"@umijs/launch-editor@1.0.0-beta.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"9059f1f09bc6ec0b919e4cdd806ba752e59e287e","size":10533,"noattachment":false,"key":"/@umijs/launch-editor/-/@umijs/launch-editor-1.0.0-beta.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@umijs/launch-editor/download/@umijs/launch-editor-1.0.0-beta.1.tgz"},"maintainers":[{"name":"chenshuai2144","email":""},{"name":"kuitos","email":""},{"name":"peachscript","email":""},{"name":"sorrycc","email":""},{"name":"xiaohuoni","email":""},{"name":"xierenyuan","email":""},{"name":"xusd320","email":""},{"name":"yifankakaxi","email":""},{"name":"zoomdong07","email":""}],"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/launch-editor_1.0.0-beta.1_1567656948414_0.034609535902542454"},"_hasShrinkwrap":false,"publish_time":1567656948584,"_cnpm_publish_time":1567656948584,"_cnpmcore_publish_time":"2021-12-16T14:02:01.326Z"}},"readme":"# launch-editor\n\n[![Coverage Status](https://coveralls.io/repos/github/umijs/launch-editor/badge.svg?branch=master)](https://coveralls.io/github/umijs/launch-editor?branch=master) [![NPM version](https://img.shields.io/npm/v/@umijs/launch-editor.svg?style=flat)](https://npmjs.org/package/@umijs/launch-editor) [![NPM downloads](http://img.shields.io/npm/dm/@umijs/launch-editor.svg?style=flat)](https://npmjs.org/package/@umijs/launch-editor)\n\n✏️ Launch your code editor using Node.js.\n\n## Feature\n- [x] support `async/await`\n- [x] error handlers and codes\n- [ ] support more editors and platforms.\n- [x] specify the editor to launch\n\n\n## Install\n\n```sh\n$ npm install @umijs/launch-editor -S\n```\n\n## Usage\n\nCommonjs\n\n```js\nconst launchEditor = require('@umijs/launch-editor');\n\n(async () => {\n  try {\n   const res = await launchEditor.default(config)\n  } catch (e) {}\n})()\n\n```\n\nES6 / TypeScript\n\n```js\nimport launchEditor from '@umijs/launch-editor';\n\n(async () => {\n  try {\n   const res = await launchEditor(config)\n  } catch (e) {}\n})()\n```\n\nConfiguration\n\n### launchEditor(path, [options]): Promise<void>\n\n#### path\n\nType: `string` | `object` | `Array<string | object>`\n\nfiles or project path you want to open in the editor.\n\n#### options\n\nType: `object`\n\n##### editor\nType: `string` | `string[]`\nDefault: Auto-detected (current process or existed editors, envs)\n\nthe function return a `Promise`, if having an error when launching the editor, there are some error `code` and `message`, `editor` (if you specify) you might use.\n\n| code | message |\n|--------|------|\n| `EPERM` | the path is permission denied |\n| `UNKNOWN` | couldn't find your editor, might not install |\n| `OTHER` | unknown error couldn't catch |\n\n##### editorOpts\nType: `object`\nDefault: `[]`\n\nExtra options for the specified editor params, e.g., VSCode using  `[\"-n\"]` to force to open a new window.\n\n### getEditors(): void\nguess how many editors you have in current system.\n\nCommonjs\n\n```ts\nconst { getEditors }  = require('@umijs/launch-editor');\n\nguessEditor();\n\n=>\n\n[\n  { name: 'subl', commands: [''] },\n  { name: 'vscode', commands: [''] },\n  { name: 'idea', commands: [''] },\n  { name: 'atom', commands: [''] },\n]\n```\n\n\n## Development\n\n```sh\n$ npm install\n$ npm run dev\n```\n\n## Test\n\n```sh\n$ npm install\n$ npm run test\n```\n\n##\n\n### Supported editors\n\n| Value | Editor | Linux | Windows | OSX |\n|--------|------|:------:|:------:|:------:|\n| `code` | [Visual Studio Code](https://code.visualstudio.com/) |✓|✓|✓|\n| `atom` | [Atom](https://atom.io/) |✓||✓|\n| `code-insiders` | [Visual Studio Code Insiders](https://code.visualstudio.com/insiders/) |✓|✓|✓|\n| `sublime` | [Sublime Text](https://www.sublimetext.com/) |✓|✓|✓|\n| `webstorm` | [WebStorm](https://www.jetbrains.com/webstorm/) |✓|✓|✓|\n| `idea` | [IDEA](https://www.jetbrains.com/idea/) |✓||✓|\n","_attachments":{},"homepage":"https://github.com/umijs/launch-editor#readme","bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"license":"MIT"}