1. License
“Permission is hereby granted, free of charge, to any person obtaining a copy of this software”
Any use, including paid and closed-source tools.
github.com/sindresorhus/open/blob/main/license3. Used by agents' projects
Dependency in 31 public GitHub projects set up for AI coding agents that we scanned (0.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What open does
open is a small free Node.js library that opens a web link in the default browser, a file in its usual program, or an app. It works the same on Mac, Windows and Linux. It is made for command-line tools and scripts on your own computer, not for websites or servers.
What people build with it
Sign-in page from a terminal tool
Your command-line tool needs the person to log in; it opens the sign-in page in their usual browser instead of asking them to copy a link.
Show a report the script just made
A script builds a PDF or a chart and opens it in the default viewer, then waits until the person closes the viewer.
A chosen browser or private window
Open a test page in Chrome or Firefox, or in a private window, without writing different code for each system.
Start a desktop app
A setup script opens an app such as an editor or a browser with extra options.
Open the local site after start Idea
Your dev script starts a local server and then opens its address in the browser, so the person sees the site right away.
Open the folder with results Idea
After an export finishes, the tool opens the output folder so the person finds the files at once.
open popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How open is used
- open is a dependency in 31 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.6% of the 4,867 JavaScript/TypeScript ones), #42 of 299 in dev workflow and config.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 121; those are left out of every share on this page.
- Projects that use it most often also use Express (54.8%), Marked (51.6%), Commander (45.2%).
By coding agent
Often used with
More about open
Funding
- GitHub Sponsors: https://github.com/sindresorhus
- Open Collective: https://opencollective.com/sindresorhus
- Buy Me a Coffee: https://buymeacoffee.com/sindresorhus
- Own page: https://sindresorhus.com/donate
- 186 GitHub sponsors
Agent Skills for it
- open: Boot the session, load context from the vault, and surface what matters
More in Dev workflow and config
Alternatives
open This page
Pick open-cli when you want the same opening behaviour as a terminal command, without writing Node.js code.
Pick chrome-launcher when you need a Chrome window your code can control for automation, not just a page for a person to look at.
Pick execa when you need to run any program and read its output, not just open something in its default app.
Get started
Tell your AI assistant
“In this Node.js command-line tool, use open@11.0.4 (ES module import, Node.js 20+) to open the sign-in link in the default browser; only pass links the tool built itself, never raw user input.”
Install it in your Node.js project (Node.js 20 or newer).
npm install openImport it as an ES module and call open() with a link, a file or an app.
import open, {openApp, apps} from 'open'; // Opens the URL in the default browser. await open('https://example.com'); // Open an app. await openApp('xcode');
Mistakes to avoid
The package has no CommonJS export; require() fails with ERR_REQUIRE_ESM on older Node.js.
The library passes the value on as is; untrusted input can start other programs.
App names differ by system (google chrome, google-chrome, chrome); apps picks the right one.
A running browser takes the link and the command ends at once.
open() starts a program on the machine where the code runs, which on a server is the server itself.
Questions
Does it work in a website?
No. It runs in Node.js on the person's own computer; in a browser page use a normal link or window.open.
Why does wait not wait when I open a link?
When the browser is already running, the link is handed to it and the command ends at once. On a Mac, newInstance forces a new browser.
Can I use it with require()?
Not directly. It is an ES module only; use import, or the dynamic import() function from older code.
Does it work in WSL on Windows?
Yes. It uses Windows through PowerShell when it can and falls back to the Linux opener.