Gathering detailed insights and metrics for opn
Gathering detailed insights and metrics for opn
Gathering detailed insights and metrics for opn
Gathering detailed insights and metrics for opn
Open stuff like URLs, files, executables. Cross-platform.
npm install opn
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.5
Supply Chain
99
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (96.34%)
TypeScript (3.66%)
Total Downloads
2,877,403,528
Last Day
240,201
Last Week
4,340,498
Last Month
19,106,130
Last Year
230,549,941
MIT License
3,295 Stars
203 Commits
253 Forks
29 Watchers
1 Branches
56 Contributors
Updated on Jun 27, 2025
Minified
Minified + Gzipped
Latest Version
6.0.0
Package Id
opn@6.0.0
Size
9.80 kB
NPM Version
6.9.0
Node Version
8.15.0
Published on
Mar 26, 2019
Cumulative downloads
Total Downloads
Last Day
-14.8%
240,201
Compared to previous day
Last Week
-7.9%
4,340,498
Compared to previous week
Last Month
2%
19,106,130
Compared to previous month
Last Year
-17.2%
230,549,941
Compared to previous year
Open stuff like URLs, files, executables. Cross-platform.
If need this for Electron, use shell.openItem()
instead.
Note: The original open
package was recently deprecated in favor of this package, and we got the name, so this package is now named open
instead of opn
. If you're upgrading from the original open
package (open@0.0.5
or lower), keep in mind that the API is different.
spawn
instead of exec
.node-open
issues.xdg-open
script for Linux./mnt/*
.$ npm install open
1const open = require('open'); 2 3// Opens the image in the default image viewer 4(async () => { 5 await open('unicorn.png', {wait: true}); 6 console.log('The image viewer app closed'); 7 8 // Opens the url in the default browser 9 await open('https://sindresorhus.com'); 10 11 // Specify the app to open in 12 await open('https://sindresorhus.com', {app: 'firefox'}); 13 14 // Specify app arguments 15 await open('https://sindresorhus.com', {app: ['google chrome', '--incognito']}); 16})();
It uses the command open
on macOS, start
on Windows and xdg-open
on other platforms.
Returns a promise for the spawned child process. You would normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process.
Type: string
The thing you want to open. Can be a URL, file, or executable.
Opens in the default app for the file type. For example, URLs opens in your default browser.
Type: Object
Type: boolean
Default: false
Wait for the opened app to exit before fulfilling the promise. If false
it's fulfilled immediately when opening the app.
Note that it waits for the app to exit, not just for the window to close.
On Windows, you have to explicitly specify an app for it to be able to wait.
Type: string | string[]
Specify the app to open the target
with, or an array with the app and app arguments.
The app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is google chrome
on macOS, google-chrome
on Linux and chrome
on Windows.
You may also pass in the app's full path. For example on WSL, this can be /mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe
for the Windows installation of Chrome.
MIT © Sindre Sorhus
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
Found 10/30 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More