opener
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Opener is a versatile, cross-platform utility that enables the opening of various types of content within your desktop environment. It can open web pages, local files, and executables, making it possible to create actual windows that pop up with the selected content. Whether you need to launch a website, view a text file, open an application like Firefox, or run a specific command like 'npm run lint', opener accomplishes this effectively.
Here's how to use Opener for different purposes:
First you need to install it globally using npm:
npm install opener -g
Then you can run the opener
command followed by the content you wish to open:
opener http://google.com
opener ./my-file.txt
opener firefox
opener npm run lint
If you want to use Opener programmatically, you can integrate it into your JavaScript files:
var opener = require("opener");
opener("http://google.com");
opener("./my-file.txt");
opener("firefox");
opener("npm run lint");
Opener also returns the child process created, allowing your script to exit while the window remains open:
var editor = opener("documentation.odt");
editor.unref();
editor.stdin.unref();
editor.stdout.unref();
editor.stderr.unref();
You can also use Opener in your package's test script to automatically open a test harness in the user's browser:
{
"scripts": {
"test": "opener ./test/runner.html"
},
"devDependencies": {
"opener": "*"
}
}
You can refer to the Opener documentation and example usage within the readme file provided in its GitHub repository, accessible via this URL: https://github.com/domenic/opener. This readme file presents a comprehensive overview of the functionalities Opener offers and how to integrate them into your projects.