{"id":13583287,"url":"https://github.com/sindresorhus/open-editor","last_synced_at":"2025-05-14T13:06:00.362Z","repository":{"id":20563167,"uuid":"90271381","full_name":"sindresorhus/open-editor","owner":"sindresorhus","description":"Open files in your editor at a specific line and column","archived":false,"fork":false,"pushed_at":"2024-12-22T18:06:42.000Z","size":27,"stargazers_count":203,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-27T17:39:35.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2017-05-04T14:13:37.000Z","updated_at":"2025-04-20T06:56:37.000Z","dependencies_parsed_at":"2025-01-16T04:23:52.179Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/open-editor","commit_stats":{"total_commits":32,"total_committers":11,"mean_commits":2.909090909090909,"dds":0.4375,"last_synced_commit":"d294ee3dddb4f985d062d93fbed5868a249d32cf"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fopen-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fopen-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fopen-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fopen-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/open-editor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252020905,"owners_count":21681717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:03:22.908Z","updated_at":"2025-05-14T13:06:00.327Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Packages"],"sub_categories":[],"readme":"# open-editor\n\n\u003e Open files in your editor at a specific line and column\n\nSupports any editor, but only the following editors will open at a specific line and column:\n\n- Sublime Text\n- Atom\n- Zed\n- Visual Studio Code\n- VSCodium\n- WebStorm*\n- TextMate\n- Vim\n- NeoVim\n- IntelliJ IDEA*\n\n*\\*Doesn't support column.*\n\n## Install\n\n```sh\nnpm install open-editor\n```\n\n## Usage\n\n```js\nimport openEditor from 'open-editor';\n\nopenEditor([\n\t{\n\t\tfile: 'readme.md',\n\t\tline: 10,\n\t\tcolumn: 2,\n\t}\n]);\n\nopenEditor([\n\t'unicorn.js:5:3',\n]);\n```\n\n## API\n\n### openEditor(files, options?)\n\nOpen the given files in the user's editor at specific line and column if supported by the editor. It does not wait for the editor to start or quit unless you specify `wait: true` in the options.\n\n#### files\n\nType: `Array\u003cstring | object\u003e`\n\nItems should be in the format `foo.js:1:5` or `{file: 'foo.js', line: 1: column: 5}`.\n\n#### options\n\nType: `object`\n\n##### wait\n\nType: `boolean`\\\nDefault: `false`\n\nWait until the editor is closed.\n\n```js\nimport openEditor from 'open-editor';\n\nawait openEditor(['unicorn.js:5:3'], {wait: true});\n\nconsole.log('File was closed');\n```\n\n##### editor\n\nType: `string`\\\nDefault: [Auto-detected](https://github.com/sindresorhus/env-editor)\n\nThe name, command, or binary path of the editor.\n\n**Only use this option if you really have to.** Can be useful if you want to force a specific editor or implement your own auto-detection.\n\n### getEditorInfo(files, options?)\n\nSame as `openEditor()`, but returns an object with the binary name, arguments, and a flag indicating whether the editor runs in the terminal.\n\nExample: `{binary: 'subl', arguments: ['foo.js:1:5'], isTerminalEditor: false}`\n\nCan be useful if you want to handle opening the files yourself.\n\n```js\nimport {getEditorInfo} from 'open-editor';\n\ngetEditorInfo([\n\t{\n\t\tfile: 'foo.js',\n\t\tline: 1,\n\t\tcolumn: 5,\n\t}\n]);\n//=\u003e {binary: 'subl', arguments: ['foo.js:1:5'], isTerminalEditor: false}\n```\n\n## Related\n\n- [open-editor-cli](https://github.com/sindresorhus/open-editor-cli) - CLI for this module\n- [open](https://github.com/sindresorhus/open) - Open stuff like URLs, files, executables\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fopen-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fopen-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fopen-editor/lists"}