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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@exodus/browser-extension-cli

v1.6.2

Published

Common tools used in building the browser extension

Readme

@exodus/browser-extension-base

This package serves as a foundation framework for the Exodus Browser Extensions ecosystem. It provides common build configuration, libraries, and tools.

The primary goal is to enable the development of browser extension projects by building upon this framework.

Installation

yarn add @exodus/browser-extension-base --dev

Setup

This package aims to be agnostic and configurable. To utilize this package, a project should define its specific configuration using an app.config.js file at the project's root.

config.manifest

The manifest property specifies the location of the manifest file. By default, it looks for /src/manifest.json.

module.exports = {
  manifest: './src/manifest.js', // It's also possible to pass JS files
}

For more complex applications, you might want to specify different manifests depending on the environment being bundled. This can be easily achieved by providing an object where each key represents the environment name, and the corresponding value is the manifest file to use for that case.

module.exports = {
  manifest: {
    development: './src/manifests/development.js',
    production: './src/manifests/production.js',
  },
}

config.entrypoints

An extension comprises multiple processes with separate lifecycles. Each process requires a different entrypoint. Typically, an application has a service worker (background) and one or more renderer processes (UIs). Each entrypoint should have a unique name, specify the process type, and indicate the entrypoint file.

module.exports = {
  entrypoints: [
    {
      name: 'index',
      processType: 'renderer',
      entry: './src/ui/index.js',
      options: { splitChunks: true },
    },
    {
      name: 'background',
      processType: 'worker',
      entry: './src/background',
    },
  ],
}

config.assets

This allows for copying static files to the distribution. When providing only a string, the basename will be placed in the distribution directory.

By providing an object with the properties from and to, you can define custom destinations inside the distribution directory.

module.exports = {
  assets: [
    // copies 'public/docs.html' to 'dist/docs.html'
    'public/docs.html',
    // copies 'public/locales/en.json' to 'dist/_locales/en.json'
    {
      from: 'public/locales/en.json',
      to: '_locales/en.json',
    },
  ],
}

config.webpack

@exodus/browser-extension-base utilizes Webpack to build the application in both production and development environments. It includes a basic webpack configuration necessary to bundle a simple application. However, each client can extend it as needed by providing a webpack function in the config file. This function is invoked for each entrypoint, allowing independent customization.

js

module.exports = {
  webpack: (config, entrypoint) => {
    // Perform any modification to webpack config
    return config
  },
}

CLI

browser-extension CLI provides a set of commands to develop and build your browser extension.

Usage

All interactions with browser-extension are of the form

browser-extension [command] [options]

Help Usage

To display basic commands and arguments

browser-extension --help

Available Commands

  • dev [options]: Used for development. Monitors entrypoints and rebuilds them when code changes, facilitating iterative development. It does not support hot reloading yet.
  • build [options]: Builds the application for production. The output is located in the /dist folder.

Available Options

  • --config <value...>: Provide path to an app configuration file e.g. ./app.config.js.

Babel

Scripts within this project automatically recognize babel.config.js files located at the project root. These configuration files are used to build both the production and development versions of the scripts.