# @tomjs/electron-devtools-installer

> Install Chrome extension for Electron, support cjs/esm

Latest version **4.0.1** (published 2025-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tomjs/electron-devtools-installer
pnpm add @tomjs/electron-devtools-installer
yarn add @tomjs/electron-devtools-installer
bun add @tomjs/electron-devtools-installer
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2025-11-16 |
| First published | 2023-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 48.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Tom Gao |
| Maintainers | tomgao365 |
| Keywords | electron, devtools, installer, chrome, extension |

## Links

- npm: https://www.npmjs.com/package/@tomjs/electron-devtools-installer
- Repository: https://github.com/tomjs/electron-devtools-installer
- Homepage: https://github.com/tomjs/electron-devtools-installer#readme
- Issues: https://github.com/tomjs/electron-devtools-installer/issues
- npm.io page: https://npm.io/package/@tomjs/electron-devtools-installer

## Dependencies (1)

- [@tomjs/unzip-crx](https://npm.io/package/@tomjs/unzip-crx.md) ^1.1.3

## Recent versions

- 4.0.1 (latest) — 2025-11-16
- 4.0.0 — 2025-11-16
- 3.0.1 — 2025-04-30
- 3.0.0 — 2025-04-30
- 2.4.0 — 2024-10-31
- 2.3.2 — 2024-07-12
- 2.3.1 — 2024-07-12
- 2.3.0 — 2024-07-11
- 2.2.2 — 2024-07-01
- 2.2.1 — 2024-03-20
- 2.2.0 — 2024-03-20
- 2.1.1 — 2024-02-27
- 2.1.0 — 2024-01-08
- 2.0.6 — 2023-12-21
- 2.0.5 — 2023-12-10
- … 7 more at https://npm.io/package/@tomjs/electron-devtools-installer/versions

## README

# @tomjs/electron-devtools-installer

[![npm](https://img.shields.io/npm/v/@tomjs/electron-devtools-installer)](https://www.npmjs.com/package/@tomjs/electron-devtools-installer) ![node-current (scoped)](https://img.shields.io/node/v/@tomjs/electron-devtools-installer) ![NPM](https://img.shields.io/npm/l/@tomjs/electron-devtools-installer) [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@tomjs/electron-devtools-installer)

**English** | [中文](./README.zh_CN.md)

> Install Chrome extension for [Electron](https://electronjs.org/), support `cjs`/`esm`.

This library is based on [Samuel Attard](https://github.com/MarshallOfSound)'s [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) and [JonLuca De Caro](https://github.com/jonluca)'s [electron-extension-installer](https://github.com/JonLuca/electron-extension-installer), with some modifications and added small features. It provides support for `esm` and `cjs` to support for `Electron v28+`.

For Chrome DevTools installation, please visit the [Official Documentation](https://www.electronjs.org/docs/latest/tutorial/devtools-extension).

## Features

- Support `cjs`/`esm`
- Support `Electron v28+` to use `esm`

## Install

```bash
# pnpm
pnpm add @tomjs/electron-devtools-installer

# yarn
yarn add @tomjs/electron-devtools-installer

# npm
npm add @tomjs/electron-devtools-installer
```

## Usage

- **esm**

```js
import { installExtension, VUEJS_DEVTOOLS } from '@tomjs/electron-devtools-installer';
import { app } from 'electron';

// Install Vue.js DevTools
app.whenReady().then(() => {
  installExtension(VUEJS_DEVTOOLS) // equals to installExtension("nhdogjmejiglipccpnnnanhbledajbpd")
    .then(ext => console.log(`Added Extension:  ${ext.name}`))
    .catch(err => console.log('An error occurred: ', err));
});
```

- **cjs**

```js
const { installExtension, VUEJS_DEVTOOLS } = require('@tomjs/electron-devtools-installer');
const { app } = require('electron');

// Install Vue.js DevTools
app.whenReady().then(() => {
  installExtension(VUEJS_DEVTOOLS)
    .then(ext => console.log(`Added Extension:  ${ext.name}`))
    .catch(err => console.log('An error occurred: ', err));
});
```

## Documentation

- [API Document](https://www.jsdocs.io/package/@tomjs/electron-devtools-installer) provided by [jsdocs.io](https://www.jsdocs.io).
- [index.d.ts](https://www.unpkg.com/browse/@tomjs/electron-devtools-installer/dist/index.d.ts) provided by [unpkg.com](https://www.unpkg.com).

## API

### Preset Chrome Extensions ID

The following is a list of preset Chrome extensions ID:

| ID                       | Name                                                                                                |
| ------------------------ | --------------------------------------------------------------------------------------------------- |
| `ANGULAR_DEVTOOLS`       | [Angular DevTools](https://chromewebstore.google.com/detail/ienfalfjdbdpebioblfackkekamfmbnh)       |
| `APOLLO_CLIENT_TOOLS`    | [Apollo Client Devtools](https://chromewebstore.google.com/detail/jdkknkkbebbapilgoeccciglkfbmbnfm) |
| `BACKBONE_DEBUGGER`      | [Backbone Debugger](https://chromewebstore.google.com/detail/bhljhndlimiafopmmhjlgfpnnchjjbhd)      |
| `EMBER_INSPECTOR`        | [Ember Inspector](https://chromewebstore.google.com/detail/bmdblncegkenkacieihfhpjfppoconhi)        |
| `MOBX_DEVTOOLS`          | [MobX DevTools](https://chromewebstore.google.com/detail/pfgnfdagidkfgccljigdamigbcnndkod)          |
| `PREACT_DEVELOPER_TOOLS` | [Preact Developer Tools](https://chromewebstore.google.com/detail/ilcajpmogmhpliinlbcdebhbcanbghmd) |
| `REACT_DEVELOPER_TOOLS`  | [React Developer Tools](https://chromewebstore.google.com/detail/fmkadmapgofadopljbjfkapdkoienihi)  |
| `REDUX_DEVTOOLS`         | [Redux DevTools](https://chromewebstore.google.com/detail/lmhkpmbekcpmknklioeibfkpmmfibljd)         |
| `SOLID_DEVTOOLS`         | [Solid Devtools](https://chromewebstore.google.com/detail/kmcfjchnmmaeeagadbhoofajiopoceel)         |
| `SVELTE_DEVTOOLS`        | [Svelte DevTools](https://chromewebstore.google.com/detail/kfidecgcdjjfpeckbblhmfkhmlgecoff)        |
| `VUEJS_DEVTOOLS`         | [Vue.js DevTools](https://chromewebstore.google.com/detail/nhdogjmejiglipccpnnnanhbledajbpd)        |
| `VUEJS_DEVTOOLS_BETA`    | [Vue.js devtools (beta)](https://chromewebstore.google.com/detail/ljjemllljcmogpfapbkkighbhhppjdbg) |
| `VUEJS_DEVTOOLS_V5`      | [Vue.js devtools (v5)](https://chromewebstore.google.com/detail/hkddcnbhifppgmfgflgaelippbigjpjo)   |
| `VUEJS_DEVTOOLS_V6`      | [Vue.js devtools (v6)](https://chromewebstore.google.com/detail/iaajmlceplecbljialhhkmedjlpdblhp)   |

### installExtension(extensionIds[, options])

install chrome extension for electron

- **extensionIds**: `string | string[]` - Chrome extension id
- **options**: Install extension options
  - _loadExtensionOptions_: [session.LoadExtensionOptions](https://www.electronjs.org/docs/latest/api/session#sesloadextensionpath-options)
  - _forceDownload_: `boolean` - Force to download the extension even if it's already installed, default is `false`
  - _source_: `'chrome' | 'unpkg' | 'jsdelivr' | 'npmmirror'` - Download url source. When the OS language is `zh_CN` , the default value is `npmmirror`, otherwise it is `chrome`.
  - _session_: `'string' | 'Electron.Session'` - The target session on which the extension shall be installed, default is `session.defaultSession`.

Returns `Promise<Electron.Extension | Electron.Extension[]>` - extension name/version, etc.

### downloadExtension(extensionId[, options])

download chrome extension for electron

- **extensionId**: `string` - Chrome extension id
- **options**: Download extension options
  - _force_: `boolean` - Force to download the extension even if it's already installed, default is `false`
  - _unzip_: `boolean` - Whether to unzip the downloaded file, default is `true`
  - _attempts_: `number` - Number of attempts to download the extension, default is `5`
  - _outPath_: `string` - The path to save the downloaded extension, default is `path.join(app.getPath('userData'), 'extensions')`
  - _source_: `'chrome' | 'unpkg' | 'jsdelivr' | 'npmmirror'` - Download url source. When the OS language is `zh_CN` , the default value is `npmmirror`, otherwise it is `unpkg`.

Returns `Promise<{ filePath: string; unzipPath?: string }>`

## Test/Debug

```bash
pnpm jest --verbose false
```

---
_Source: https://npm.io/package/@tomjs/electron-devtools-installer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
