Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

open

Launch a link, file or app from Node.js.

Dev workflow and configNPM

GitHubWebsite

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/license

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

67 / 100
Gid Score, #521 overall
238M
downloads a week, npm
3,523
GitHub stars
31
agent projects use it
open: downloads per weeknpm, open 238,498,170
open: GitHub starssindresorhus/open 3,523

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

25 projects, 0.8%
14 projects, 0.5%
11 projects, 2.3%
6 projects, 0.2%

Often used with

In 54.8% of its projects
In 51.6% of its projects
In 45.2% of its projects
In 41.9% of its projects
In 48.4% of its projects
In 38.7% of its projects
In 38.7% of its projects
In 38.7% of its projects

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

See all

Agent Skills for it
  • open: Boot the session, load context from the vault, and surface what matters

See all

More in Dev workflow and config

Alternatives

open This page

MITGid 67238M/wk

open-cli

Pick open-cli when you want the same opening behaviour as a terminal command, without writing Node.js code.

chrome-launcher

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.

execa

Pick execa when you need to run any program and read its output, not just open something in its default app.

Compare open with another tool

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

  1. Install it in your Node.js project (Node.js 20 or newer).

    npm install open

    From github.com/sindresorhus/open/blob/main/readme.md

  2. Import 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');
    

    From github.com/sindresorhus/open/blob/main/readme.md

Mistakes to avoid

const open = require('open')
import open from 'open', or const {default: open} = await import('open') in CommonJS

The package has no CommonJS export; require() fails with ERR_REQUIRE_ESM on older Node.js.

await open(req.query.url) or opening a file name a user sent
Only open links and paths your code built itself; check the scheme is https and the file is one you created

The library passes the value on as is; untrusted input can start other programs.

{app: {name: 'google chrome'}} hard-coded in a shared tool
{app: {name: apps.chrome}}

App names differ by system (google chrome, google-chrome, chrome); apps picks the right one.

await open(url, {wait: true}) to wait until the person closes the browser tab
Do not use wait with browsers; on a Mac add newInstance true if you must wait

A running browser takes the link and the command ends at once.

Calling open() on a web server to show something to a site visitor
Send the visitor a link or use window.open in their browser

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.