Registry / devops / extension

extension

JSON →
library1.0.0jsnpmunverified

extension.js is a zero-configuration command-line interface (CLI) and development toolkit designed for creating, developing, and building cross-browser web extensions. It streamlines the development workflow by providing integrated tools for producing extensions compatible with major browsers including Chrome, Edge, Firefox, and Safari, all without requiring complex or manual build configurations. The package is currently stable at version 3.13.5 (as of April 11, 2026) and demonstrates a rapid release cadence with frequent patches and minor versions, highlighting active maintenance and quick turnaround on bug fixes and features. Its key differentiators include a 'zero-config' philosophy, native TypeScript support, and first-class integration with popular frameworks like React, aiming to significantly reduce setup overhead for developers targeting diverse browser environments. Beyond its CLI, extension.js also offers a programmatic API for `create` and `develop` operations, enabling custom build pipeline integration.

npm install extension
INSTALL
IMPORT
SIG · EXTENSION
E
extension
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create
import { create } from 'extension';
const { create } = require('extension');
The programmatic API for `create` is available as a named ESM export. CommonJS `require` is not officially supported for this interface, requiring Node.js ESM or a bundler.
develop
import { develop } from 'extension';
const { develop } = require('extension');
The programmatic API for `develop` is available as a named ESM export. Ensure your project is configured for ESM imports if using directly in Node.js.
Extension CLI
npx extension <command> [args]
import extension from 'extension'
While the `extension` package exports programmatic utilities, its primary interface for many users is via the `npx extension` command-line tool. There is no default export for the CLI itself.

This quickstart demonstrates how to programmatically create a new React TypeScript extension project and then launch its development server, automatically opening it in a Chromium browser with live reloading enabled.

import { create, develop } from 'extension'; import path from 'path'; import { fileURLToPath } from 'url'; import { rmSync, existsSync } from 'fs'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const projectPath = path.join(__dirname, 'temp-extension-project'); async function runExtensionDevFlow() { if (existsSync(projectPath)) { console.log(`Removing existing project directory: ${projectPath}`); rmSync(projectPath, { recursive: true, force: true }); } console.log('Creating new React TypeScript extension project...'); await create({ name: 'temp-extension-project', template: 'react-typescript', output: __dirname, }); console.log(`Project created at ${projectPath}`); console.log('Starting development server for the new extension...'); const devServer = await develop({ source: projectPath, port: 8080, browser: 'chromium', // Automatically opens Chrome with the extension loaded watch: true // Enable hot-reloading }); console.log(`Development server running on port ${devServer.port} for ${devServer.browser}.`); console.log('The browser should have opened automatically with the extension loaded.'); console.log('Press Ctrl+C in this terminal to stop the development server.'); // In a real application, you might want to keep a reference to devServer // and implement a graceful shutdown mechanism. } runExtensionDevFlow().catch(console.error);
extension --version
Debug
Known issues
breakingThe `extensionStart` option was removed from the programmatic `develop` API. The CLI now orchestrates the build and preview stages internally, simplifying the API.
fix
Remove any usage of the `extensionStart` option from your `develop` calls. The `develop` function will now handle the entire lifecycle.
affects: >=3.13.0
breakingNode.js version requirements were updated. The `extension` CLI and programmatic API now require Node.js version 18 or higher to run.
fix
Upgrade your Node.js environment to version 18 or newer (e.g., using nvm, fnm, or directly installing).
affects: <=3.x
gotchaSpecifying `--port 0` (for an OS-assigned ephemeral port) could cause the development server to crash in earlier versions.
fix
Upgrade to version `3.13.5` or later. Alternatively, specify a static, non-zero port number using `--port <number>`.
affects: <3.13.5
gotchaUser project dependency resolution for `pnpm dlx` and `npx` builds could fail or behave unexpectedly in certain scenarios.
fix
Upgrade to version `3.13.4` or later to benefit from improved dependency resolution logic.
affects: <3.13.4
gotchaThe `--install` flag, intended to skip dependency installation during `build` or `dev` commands, was not respected in previous versions, leading to unnecessary installs.
fix
Upgrade to version `3.13.4` or later to ensure the `--install` flag is correctly honored.
affects: <3.13.4
breakingA vulnerability (CVE-2026-22028) related to Preact VNode injection was fixed. Projects using affected versions are susceptible to potential XSS if untrusted content is rendered via Preact components.
fix
Upgrade to version `3.12.0` or later to mitigate the Preact VNode injection vulnerability.
affects: <3.12.0
breakingA vulnerability (GHSA-r4q5-vmmm-2653) was discovered in `follow-redirects` affecting `extension.js` versions due to a potential auth header leak during redirects.
fix
Upgrade to version `3.14.0-next.0` or later to receive the fix for the `follow-redirects` auth header leak vulnerability.
affects: <3.14.0-next.0
Errors
Common errors & fixes
Node.js version must be >= 18.0.0
Attempting to run `extension` commands or programmatic API with an older Node.js version.
fix
Update your Node.js environment to version 18 or newer. Use `nvm install 18` or similar version manager commands, then `nvm use 18`.
Error: The develop function received an unrecognized option: extensionStart
Using the deprecated `extensionStart` option in the programmatic `develop` function after version 3.13.0.
fix
Remove the `extensionStart` option from your `develop` function calls. The function now orchestrates the full build and preview process.
Error: Could not start dev server. Port 0 is not a valid option.
Using `--port 0` in `extension develop` or `develop()` API call, which caused a crash in affected versions.
fix
Upgrade `extension` to version `3.13.5` or newer. Alternatively, specify a different, non-zero port number.
Error: Failed to resolve dependencies for user project in build/dev command.
Dependency resolution issues encountered during `npx` or `pnpm dlx` builds for user projects in `extension` versions prior to 3.13.4.
fix
Upgrade `extension` to version `3.13.4` or newer to fix project dependency resolution issues.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources