Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

open-editor

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-editor

Open files in your editor at a specific line and column

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75K
decreased by-22.77%
Maintainers
1
Weekly downloads
 
Created
Source

open-editor Build Status

Open files in your editor at a specific line and column

Supports any editor, but only the following editors will open at a specific line and column:

  • Sublime Text
  • Atom
  • Visual Studio Code
  • WebStorm*
  • TextMate*

*Doesn't support column.

Install

$ npm install --save open-editor

Usage

const openEditor = require('open-editor');

openEditor([
	'unicorn.js:5:3',
	{
		file: 'readme.md',
		line: 10,
		column: 2
	}
]);

API

openEditor(files, [options])

Open 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.

files

Type: Array<string|Object>

Items should be in the format foo.js:1:5 or {file: 'foo.js', line: 1: column: 5}.

options

Type: Object

editor

Type: string
Default: Auto-detected

Name, command, or binary path of the editor. 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.

openEditor.make(files, [options])

Same as openEditor(), but returns an object with the binary name and arguments.

Example: {bin: 'subl', args: ['foo.js:1:5']}

Can be useful if you want to handle opening the files yourself.

License

MIT © Sindre Sorhus

Keywords

FAQs

Package last updated on 04 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc