npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

edge-location

v2.3.0

Published

Approximates the current location of the Edge browser across platforms.

Readme

Approximates the current location of the Edge browser across platforms.

edge-location Version Downloads workflow Provenance

  • By default checks only stable. Optionally can cascade to beta / dev / canary.
  • Supports macOS / Windows / Linux
  • Works both as an ES module or CommonJS

Installation

npm i edge-location

Usage

Via Node.js (strict by default):

import edgeLocation from 'edge-location'

// Strict (Stable only)
console.log(edgeLocation())
// => "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" or null

// Enable fallback (Stable / Beta / Dev / Canary)
console.log(edgeLocation(true))
// => first found among Stable/Beta/Dev/Canary or null

// Throw with an install guide when not found
import {locateEdgeOrExplain, getInstallGuidance} from 'edge-location'
try {
  const path = locateEdgeOrExplain({allowFallback: true})
  console.log(path)
} catch (e) {
  console.error(String(e))
  // Or print getInstallGuidance() explicitly
}

CommonJS:

const api = require('edge-location')
const locateEdge = api.default || api

Via CLI:

npx edge-location
# Strict (Stable only)

npx edge-location --fallback
# Enable cascade (Stable / Beta / Dev / Canary)

# Respect environment overrides
EDGE_BINARY=/custom/path/to/msedge npx edge-location

# If not found, install Edge via Playwright and re-run
npx playwright install msedge

Environment overrides

If this environment variable is set and points to an existing binary, it takes precedence:

  • EDGE_BINARY

When nothing is found

When nothing is found, the helper throws with this message:

We couldn't find a Microsoft Edge browser on this machine.

To install one:

1) Install Edge via Playwright (recommended for CI/dev)
   npx playwright install msedge

Re-run your command afterward and it will be detected automatically.

Alternatively, install Microsoft Edge from the official site and re-run.

Support table

By default, only the Stable channel is checked. When fallback is enabled, Beta, Dev, and Canary are also checked (in that order) and the first existing path is returned.

Returns the first existing path found (given selected channels), or null if none are found.

API

  • default export locateEdge(allowFallback?: boolean): string | null

    • Returns the first existing path among the selected channels or null.
    • When allowFallback is true, checks Stable → Beta → Dev → Canary.
  • locateEdgeOrExplain(options?: boolean | { allowFallback?: boolean }): string

    • Returns a path if found, otherwise throws an Error with a friendly installation guide.
  • getEdgeVersion(bin: string, opts?: { allowExec?: boolean }): string | null

    • Cross-platform version resolver that does not execute the browser by default.
    • Windows: reads PE file metadata via PowerShell (no GUI spawn).
    • macOS: reads Info.plist (no GUI spawn).
    • Linux/other: returns null unless allowExec is true, then tries --version.
  • getInstallGuidance(): string

    • Returns the same guidance text used by locateEdgeOrExplain().

Related projects

License

MIT (c) Cezar Augusto.