{"_id":"@umijs/launch-editor","_rev":"21-e54fe704375f872ee4a236de81eda80d","name":"@umijs/launch-editor","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0-beta.1":{"name":"@umijs/launch-editor","version":"1.0.0-beta.1","keywords":["editor","launch","nodejs"],"license":"MIT","_id":"@umijs/launch-editor@1.0.0-beta.1","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"kuitos","email":"kuitos.lau@gmail.com"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"fan576679268","email":"576679268@qq.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"},{"name":"yutingzhao1991","email":"yutingzhao1991@sina.com"},{"name":"zinkey","email":"zinkey@vip.qq.com"},{"name":"sorrycc","email":"sorrycc@gmail.com"}],"homepage":"https://github.com/umijs/launch-editor#readme","bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"dist":{"shasum":"9059f1f09bc6ec0b919e4cdd806ba752e59e287e","tarball":"https://registry.npmjs.org/@umijs/launch-editor/-/launch-editor-1.0.0-beta.1.tgz","fileCount":41,"integrity":"sha512-z1xQUgyGr+iC401/78E2b1fW7aQiM6YnAwBzs/cPTmKOokxNE2pixqTjunOOFqFoXobu3jRg8AMCfjwoRJTnqQ==","signatures":[{"sig":"MEUCIQDdNQSG0QytduSd2d1nE56MRbB3reuAOCyP+JpT0JyPtwIgaFBgFHME4kfNwNGD56A8TMxuAkKmX+9EHm+IzO+t42E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43833,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcIv1CRA9TVsSAnZWagAAKHUP/1CANF6R0zFaEWjTvdeD\n3mjIsYkKtwOxdTvMK5zsVAEOLHzWzbIJTcDb3Zxu8hxpUmSLFiipDquxj+Jr\npt64lSWuqHAFoL8JmbobVXyCx64tAKHF+/AE1PSnKwOdnZLYa6rlhdw/CWLV\nY10uuiKkCnge23BpByM3htcyx5yFhh3RJTFga1V++03aOtRsuolLnh837Xu7\nV/QntrVC2O+4jN/hjigsg/oG2za8VpnKEKat478D07swWMEfMr6BYQBugoHc\nGvIpU8if8sqCiAV5y/vV7upLJk3IpmVi/RhV2OBhHnSWeu1tL2OfdioTyWac\nlfCELakjWZ/KdStqRZffQUp4dBXPT+KAQBj8oI6ThhC1bFQL3TZN2RZIgxkt\nSEaZHQTzrZkP+92VGdZUgJYL2/722hxBYNSXYTgeJCMzhRQCSM+BifOORvpI\nGKC0KkYltT/pHGn09mY2fuJF7kchRMFYU88qrA6izE39a/qFi2tEEMCzw/Ba\nRWxnQGuBHr2eqK9csPmAv66iwgF4x3iqD2NMYl9pmEe1+6TcvZ6kviQoc2be\nUuYh/6QygIBEZ4USKKe3Vy9aO38O0Z7KjG7/RbpgzwvC2zUFgWu+Q2/MICm4\n7ei4iq43p/gj29QD7UiWa0GyETARyVgKSAlfHi5YX1bK9K4m6cJZgCGF0k07\nrlM6\r\n=Ds3n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","authors":{"name":"ycjcl868","email":"45808948@qq.com"},"gitHead":"1371476066050430bd5d24d02e48db96b03feca7","scripts":{"dev":"npm run build && node test/test.js","test":"umi-test --coverage","build":"tsc","coveralls":"cat ./coverage/lcov.info | coveralls","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"repository":{"url":"git+https://github.com/umijs/launch-editor.git","type":"git"},"_npmVersion":"6.9.0","description":"launch your code editor using Node.js.","directories":{},"_nodeVersion":"10.16.0","dependencies":{"cross-spawn":"^7.0.0","@types/chalk":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nodemon":"^1.19.2","coverage":"^0.4.0","umi-test":"^1.7.1","typescript":"^3.6.2","@types/jest":"^24.0.18","@types/node":"^12.7.3","concurrently":"^4.1.2","@umijs/fabric":"^1.1.10"},"_npmOperationalInternal":{"tmp":"tmp/launch-editor_1.0.0-beta.1_1567656948414_0.034609535902542454","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@umijs/launch-editor","version":"1.0.0","keywords":["editor","launch","nodejs"],"license":"MIT","_id":"@umijs/launch-editor@1.0.0","maintainers":[{"name":"chenshuai2144","email":"wasd2144@hotmail.com"},{"name":"fan576679268","email":"576679268@qq.com"},{"name":"kuitos","email":"kuitos.lau@gmail.com"},{"name":"sorrycc","email":"sorrycc@gmail.com"},{"name":"tli4","email":"a@tianyi.li"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"yutingzhao1991","email":"yutingzhao1991@sina.com"},{"name":"zinkey","email":"zinkey@vip.qq.com"},{"name":"zombiej","email":"smith3816@gmail.com"}],"homepage":"https://github.com/umijs/launch-editor#readme","bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"dist":{"shasum":"90cf02752c00c93107767ef26aae32aa5a107015","tarball":"https://registry.npmjs.org/@umijs/launch-editor/-/launch-editor-1.0.0.tgz","fileCount":41,"integrity":"sha512-MzUKOBI8ibbFXsP8eCD5Ae1xnxygzfd341YmHJxFhXQRrq7qyAr7yAfWcTimaFk2MlrBhHOL9hafgqHhk+pHcA==","signatures":[{"sig":"MEUCIGxgQ4zMNwx9bsgACm267829hmHFIF6E+IGTXJvEFNhEAiEAlyVRiGA5hvcNMkDU3gBZx0vHLWtkJjVFO1orPet4ML0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":44664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjZHLCRA9TVsSAnZWagAANt4P/3SF3j2z9wjSPJGrPYOh\nc1blKOBI2EyResGNL5yBqLLb+5UV+5EZCI+w9N6b6E6wVi2OHuVQ7kz9uogH\nE9KZmugIsrBr0KGqil92E2vh75tPxrhaaeFoJfBwZusv4jnjwdFHKL+a0jZH\nPv3jx6vl8Y3x/m2sTb+QiF1o0biikiO/J/n/K27tB0jGcHBODFmxKC3RULVK\nkOU6d92uozGmEoc8phdmj3QAisGRnEiiIzkMbMR9/y5Xa/2H1hq9fvC5Ea3j\n6gVGSXnESdu5dj9lqJ2+hQcRbnK5cXj92J3SknYRndc9dS7ypXPfa94BLSzl\nWSRfUqf1Ohj3KX2SYdV0RdB6GuJnALW6AugxVeGbdWDrVvV5PYOTcR+NoNis\neqoDkTG29xilfJ9gb4CiAfc8SwxeTpBlLGdDNUZGgPP5exbeGtmLW0X+R6N1\n4oDZWm8lHauzo4P+bxBZeNABsfRxGr3PrFkP2O/BGipWmNGYksFip6YhgdGi\nLzVBCpdFm5SdT/7j1g0EoBCBgUrfc2RwcdA193kEzbEtD6hCpdfw+s47AioS\n3OiPzrOT0+Fp2c/BtzgRgFAHkGOW1zvEBlFaerLXeMEhfYLYRwheSeFFigHH\nUaWU6Qoobc/MTnXfAjScECB1Alza3Exx0iQlvr249E8n/a+e0i+XiINi46cU\nSbq7\r\n=lH4U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","authors":{"name":"ycjcl868","email":"45808948@qq.com"},"gitHead":"394038072f2732ec043ea071864d0d119e7f5626","scripts":{"dev":"npm run build && node test/test.js","test":"umi-test --coverage","build":"tsc","coveralls":"cat ./coverage/lcov.info | coveralls","prepublishOnly":"npm run build && npm run test"},"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"repository":{"url":"git+https://github.com/umijs/launch-editor.git","type":"git"},"_npmVersion":"6.9.0","description":"launch your code editor using Node.js.","directories":{},"_nodeVersion":"10.16.0","dependencies":{"debug":"^4.1.1","user-home":"^2.0.0","cross-spawn":"^7.0.0","@types/chalk":"^2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nodemon":"^1.19.2","coverage":"^0.4.0","umi-test":"^1.7.1","typescript":"^3.6.2","@types/jest":"^24.0.18","@types/node":"^12.7.3","concurrently":"^4.1.2","@umijs/fabric":"^1.1.10"},"_npmOperationalInternal":{"tmp":"tmp/launch-editor_1.0.0_1569558986978_0.8162817286850259","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@umijs/launch-editor","version":"1.0.1","keywords":["editor","launch","nodejs"],"license":"MIT","_id":"@umijs/launch-editor@1.0.1","maintainers":[{"name":"chenshuai2144","email":"wasd2144@hotmail.com"},{"name":"fan576679268","email":"576679268@qq.com"},{"name":"kuitos","email":"kuitos.lau@gmail.com"},{"name":"sorrycc","email":"sorrycc@gmail.com"},{"name":"tli4","email":"a@tianyi.li"},{"name":"ycjcl868","email":"45808948@qq.com"},{"name":"yutingzhao1991","email":"yutingzhao1991@sina.com"},{"name":"zinkey","email":"zinkey@vip.qq.com"},{"name":"zombiej","email":"smith3816@gmail.com"}],"homepage":"https://github.com/umijs/launch-editor#readme","bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"dist":{"shasum":"602c2a1210bb0417470c575d19cd184cbbae3255","tarball":"https://registry.npmjs.org/@umijs/launch-editor/-/launch-editor-1.0.1.tgz","fileCount":44,"integrity":"sha512-slyYS1BH3Rwic49J641dXSYeDwtkD/A1Cfp4SbQlz1v8GfLeZ1hC952O6hvK98ZTxqk4BogYFObyZcI/RqQVEw==","signatures":[{"sig":"MEUCIQClK3U+0MJAhgWO8NB2JGigqnhWfjc8ZOy5UTKqP9pAUwIgKLRP1JmIvqxNicgxHOf7n8XzVesLGpzcJdgdy+n8mbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":45035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpnQbCRA9TVsSAnZWagAA1aUP/R4ZWyy9oseCaz5GbD3N\n1Er8D6JyWoBYgaMiIjArAirZCoFTB3O7f2K56icvPxdRB1o5RlxDWGUENjOv\npfY9EJ9REhHnYZjxyZPWz9Au4cOBsLXAM4EJDRUYqKn1OQcdwy7/qlhrgRQg\ncQvQ75EdmjUAFtMROX/yc7UhaX3AbLo946MVOXtq925LpqjiVZE8QaF8nrMT\nAMKckeJ9aky/rbhfcR1hORP/RQIxWZ3pQ2q7VvTOX6a9RSNljLY3v7mvPj55\n8QZkPDlMVSlJ2sEW1cq6l8C8V1fXOC+rVn2SCzRxrEyeZ0EeaLw4c/UzpQOX\n8qqav9iCIUkUIjjsbjWeMpiIMYOPBvNPiBB6grIU7w8xTNfOIU+jvbfSWHDL\nvx1HEzsl0pWgAISJNuQg7EDQv42+w7NG3BLdxi4qSrJaMK9EPvlJvIwt1FSn\nmDJ03Gz+SU6nOC2KJnOG7UiRi7p19Q0J59CVEqxgur1vGAifU0ggsy4I5nBO\n67H0+dk+Tr2VlLyaBy8yZKhZKgKy0LrJ2XHtZ5Hfeko64jThdDnPB1Ug4yxe\nrZ0Sy+y+u4ZUYwdvXgks/npYaAdyyj7rN47ZEQHV6JPWzgTkhb3DBlxk1GL4\ncFEguI/j5oY12SJf43RP0pJe2nxgeMp45Mhij4zfXEWXjw1k7hjGPpXU+mD3\n1Khi\r\n=6LJQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","authors":{"name":"ycjcl868","email":"45808948@qq.com"},"gitHead":"bc7587a8bb91ddee424d3025b4f1362ee64e31bf","scripts":{"dev":"npm run build && node test/test.js","test":"umi-test --coverage","build":"tsc","coveralls":"cat ./coverage/lcov.info | coveralls","prepublishOnly":"npm run build && npm run test && np --no-cleanup --yolo --no-publish"},"_npmUser":{"name":"ycjcl868","email":"45808948@qq.com"},"repository":{"url":"git+https://github.com/umijs/launch-editor.git","type":"git"},"_npmVersion":"6.9.0","description":"launch your code editor using Node.js.","directories":{},"_nodeVersion":"10.16.0","dependencies":{"debug":"^4.1.1","user-home":"^2.0.0","cross-spawn":"^7.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^5.0.1","nodemon":"^1.19.2","coverage":"^0.4.0","umi-test":"^1.7.1","typescript":"^3.6.2","@types/jest":"^24.0.18","@types/node":"^12.7.3","@types/chalk":"^2.2.0","concurrently":"^4.1.2","@umijs/fabric":"^1.1.10"},"_npmOperationalInternal":{"tmp":"tmp/launch-editor_1.0.1_1571189787085_0.5047092185566282","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-09-05T04:15:48.199Z","modified":"2025-09-10T06:48:46.118Z","1.0.0-beta.1":"2019-09-05T04:15:48.584Z","1.0.0":"2019-09-27T04:36:27.126Z","1.0.1":"2019-10-16T01:36:27.241Z"},"bugs":{"url":"https://github.com/umijs/launch-editor/issues"},"license":"MIT","homepage":"https://github.com/umijs/launch-editor#readme","keywords":["editor","launch","nodejs"],"repository":{"url":"git+https://github.com/umijs/launch-editor.git","type":"git"},"description":"launch your code editor using Node.js.","maintainers":[{"email":"sorrycc@gmail.com","name":"sorrycc"},{"email":"wasd2144@hotmail.com","name":"chenshuai2144"},{"email":"kuitos.lau@gmail.com","name":"kuitos"},{"email":"scdzwyxst@gmail.com","name":"peachscript"},{"email":"448627663@qq.com","name":"xiaohuoni"},{"email":"411140932@qq.com","name":"yifankakaxi"},{"email":"xierenyuan@qq.com","name":"xierenyuan"},{"email":"xusd320@gmail.com","name":"xusd320"},{"email":"zoomdong07@gmail.com","name":"zoomdong07"}],"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","readmeFilename":"README.md"}