- Notifications
You must be signed in to change notification settings - Fork3
An example shelljs-plugin to open a file with its default application
License
shelljs/plugin-open
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
AShellJS plugin for theopen() commandto open a file (or URL) with its default application. This is largely based onopener.
This is designed to imitate theopen command on macOS. Here's theequivalent commands for other systems:
macOS
$ open file.txt# opens in a text editorLinux
$ xdg-open file.txt# opens in a text editorWindows
> start file.txt
$ npm install --save shelljs$ npm install --save shelljs-plugin-open
ShellJS unofficially has the capacity for plugins (the API is likely to change abit) since v0.7.1. Although wedon't recommend developing for this yet, thisplugin is designed to test that API, and we will adapt it along with changes toShellJS up until official plugin support. To use this plugin, you must useexactly version v0.7.1 (although, eventually this will support v1.0.0+).
To use this plugin in your project, include it like so:
varshell=require('shelljs');require('shelljs-plugin-open');// Ex. usage:shell.open('file.txt');// the plugin is now available!
- Linux (all variants)
- macOS
- Windows
This is supported for Node v0.11+
If you're interested in taking a look at the current state of the plugin API,take a look atindex.js. This has helpful comments explaining thenecessary boilerplate for writing a plugin. For an example usage of the plugin,take a look attest/test.js.
About
An example shelljs-plugin to open a file with its default application
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.