{"name":"env-editor","version":"1.3.0","description":"Get metadata on the default editor or a specific editor","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/env-editor.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["env","editor","environment","variable","default","editors","main","user","meta","metadata","info","name","binary","path","sublime","atom","vscode","webstorm","textmate","vim","neovim","intellij","nano","emacs"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"_id":"env-editor@1.3.0","gitHead":"3f6aea10ff53910c877b1bf73a8e0c954a5fbf11","bugs":{"url":"https://github.com/sindresorhus/env-editor/issues"},"homepage":"https://github.com/sindresorhus/env-editor#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-EqiD/j01PooUbeWk+etUo2TWoocjoxMfGNYpS9e47glIJ5r8WepycIki+LCbonFbPdwlqY5ETeSTAJVMih4z4w==","shasum":"bfcd8b10515962f4e96f706c1425f659d828be14","tarball":"http://registry-npm.ywwl.com/env-editor/download/env-editor-1.3.0.tgz","fileCount":5,"unpackedSize":9974,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQChZ3/gnQh9flFO7PQXAAym3W3ztydJKGQ1GjH28Or8hQIhAPNE8ceW0SbRo9NZPdAAQDqemIdW9KeHDAt7YjXCBZns"}],"size":3295,"noattachment":false,"key":"/env-editor/-/env-editor-1.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/env-editor_1.3.0_1757529819671_0.20830263497030743"},"_hasShrinkwrap":false,"readme":"# env-editor\n\n> Get metadata on the default editor or a specific editor\n\nThis module is used by [`open-editor`](https://github.com/sindresorhus/open-editor).\n\n## Supported editors\n\n- Sublime Text\n- Atom\n- Visual Studio Code\n- Visual Studio Code - Insiders\n- VSCodium\n- WebStorm\n- TextMate\n- Vim\n- NeoVim\n- IntelliJ\n- GNU nano\n- GNU Emacs\n- Android Studio\n- Xcode\n\n## Install\n\n```sh\nnpm install env-editor\n```\n\n## Usage\n\n```js\nimport {defaultEditor, getEditor, allEditors} from 'env-editor';\n\ndefaultEditor();\n/*\n{\n\tid: 'atom',\n\tname: 'Atom',\n\tbinary: 'atom',\n\tisTerminalEditor: false,\n\tpaths: [\n\t\t'/Applications/Atom.app/Contents/Resources/app/atom.sh'\n\t],\n\tkeywords: []\n}\n*/\n\ngetEditor('sublime');\n/*\n{\n\tid: 'sublime',\n\tname: 'Sublime Text',\n\tbinary: 'subl',\n\tisTerminalEditor: false,\n\tpaths: [\n\t\t'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',\n\t\t'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'\n\t],\n\tkeywords: []\n}\n*/\n\nallEditors();\n/*\n[\n\t{\n\t\tid: 'atom',\n\t\t…\n\t},\n\t{\n\t\tid: 'sublime,\n\t\t…\n\t},\n\t…\n]\n*/\n```\n\n## API\n\n### defaultEditor()\n\nReturns metadata on the default editor.\n\nThe user is expected to have the `$EDITOR` environment variable set, and if not, a user-friendly error is thrown.\n\n### getEditor(editor)\n\nReturns metadata on the specified editor.\n\n#### editor\n\nType: `string`\n\nThis can be pretty flexible. It matches against all the data it has.\n\nFor example, to get Sublime Text, you could write either of the following: `sublime`, `Sublime Text`, `subl`.\n\n### allEditors()\n\nReturns an array with metadata on all the editors.\n","publish_time":1757529819887,"_cnpm_publish_time":1757529819887,"dist-tags":{"latest":"1.3.0"}}