{"id":18822992,"url":"https://github.com/tomjs/electron-devtools-installer","last_synced_at":"2025-07-18T05:39:27.478Z","repository":{"id":210391164,"uuid":"726461298","full_name":"tomjs/electron-devtools-installer","owner":"tomjs","description":"Install Chrome extension for Electron, Support cjs/esm","archived":false,"fork":false,"pushed_at":"2024-10-31T04:34:30.000Z","size":536,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T03:18:26.704Z","etag":null,"topics":["chrome","crx","devtool","electron","extension","installer","plugin","unzip"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T13:21:39.000Z","updated_at":"2024-12-17T22:33:45.000Z","dependencies_parsed_at":"2023-12-21T13:10:42.167Z","dependency_job_id":"5158d565-1d5e-42df-a5c1-625919164bf0","html_url":"https://github.com/tomjs/electron-devtools-installer","commit_stats":null,"previous_names":["tomgao365/electron-devtools-installer","tomjs/electron-devtools-installer"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Felectron-devtools-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Felectron-devtools-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Felectron-devtools-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomjs%2Felectron-devtools-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomjs","download_url":"https://codeload.github.com/tomjs/electron-devtools-installer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248805739,"owners_count":21164380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome","crx","devtool","electron","extension","installer","plugin","unzip"],"created_at":"2024-11-08T00:52:19.046Z","updated_at":"2025-07-08T12:03:27.006Z","avatar_url":"https://github.com/tomjs.png","language":"TypeScript","readme":"# @tomjs/electron-devtools-installer\n\n[![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)\n\n**English** | [中文](./README.zh_CN.md)\n\n\u003e Install Chrome extension for [Electron](https://electronjs.org/), support `cjs`/`esm`.\n\nThis 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+`.\n\nFor Chrome DevTools installation, please visit the [Official Documentation](https://www.electronjs.org/docs/latest/tutorial/devtools-extension).\n\n## Features\n\n- Support `cjs`/`esm`\n- Support `Electron v28+` to use `esm`\n\n## Install\n\n```bash\n# pnpm\npnpm add @tomjs/electron-devtools-installer\n\n# yarn\nyarn add @tomjs/electron-devtools-installer\n\n# npm\nnpm add @tomjs/electron-devtools-installer\n```\n\n## Usage\n\n- **esm**\n\n```js\nimport { app } from 'electron';\nimport { installExtension, VUEJS_DEVTOOLS } from '@tomjs/electron-devtools-installer';\n\n// Install Vue.js DevTools\napp.whenReady().then(() =\u003e {\n  installExtension(VUEJS_DEVTOOLS) // equals to installExtension(\"nhdogjmejiglipccpnnnanhbledajbpd\")\n    .then(ext =\u003e console.log(`Added Extension:  ${ext.name}`))\n    .catch(err =\u003e console.log('An error occurred: ', err));\n});\n```\n\n- **cjs**\n\n```js\nconst { app } = require('electron');\nconst { installExtension, VUEJS_DEVTOOLS } = require('@tomjs/electron-devtools-installer');\n\n// Install Vue.js DevTools\napp.whenReady().then(() =\u003e {\n  installExtension(VUEJS_DEVTOOLS)\n    .then(ext =\u003e console.log(`Added Extension:  ${ext.name}`))\n    .catch(err =\u003e console.log('An error occurred: ', err));\n});\n```\n\n## Documentation\n\n- [API Document](https://www.jsdocs.io/package/@tomjs/electron-devtools-installer) provided by [jsdocs.io](https://www.jsdocs.io).\n- [index.d.ts](https://www.unpkg.com/browse/@tomjs/electron-devtools-installer/dist/index.d.ts) provided by [unpkg.com](https://www.unpkg.com).\n\n## API\n\n### Preset Chrome Extensions ID\n\nThe following is a list of preset Chrome extensions ID:\n\n| ID | Name |\n| --- | --- |\n| `ANGULAR_DEVTOOLS` | [Angular DevTools](https://chromewebstore.google.com/detail/ienfalfjdbdpebioblfackkekamfmbnh) |\n| `APOLLO_CLIENT_TOOLS` | [Apollo Client Devtools](https://chromewebstore.google.com/detail/jdkknkkbebbapilgoeccciglkfbmbnfm) |\n| `BACKBONE_DEBUGGER` | [Backbone Debugger](https://chromewebstore.google.com/detail/bhljhndlimiafopmmhjlgfpnnchjjbhd) |\n| `EMBER_INSPECTOR` | [Ember Inspector](https://chromewebstore.google.com/detail/bmdblncegkenkacieihfhpjfppoconhi) |\n| `MOBX_DEVTOOLS` | [MobX DevTools](https://chromewebstore.google.com/detail/pfgnfdagidkfgccljigdamigbcnndkod) |\n| `PREACT_DEVELOPER_TOOLS` | [Preact Developer Tools](https://chromewebstore.google.com/detail/ilcajpmogmhpliinlbcdebhbcanbghmd) |\n| `REACT_DEVELOPER_TOOLS` | [React Developer Tools](https://chromewebstore.google.com/detail/fmkadmapgofadopljbjfkapdkoienihi) |\n| `REDUX_DEVTOOLS` | [Redux DevTools](https://chromewebstore.google.com/detail/lmhkpmbekcpmknklioeibfkpmmfibljd) |\n| `SOLID_DEVTOOLS` | [Solid Devtools](https://chromewebstore.google.com/detail/kmcfjchnmmaeeagadbhoofajiopoceel) |\n| `SVELTE_DEVTOOLS` | [Svelte DevTools](https://chromewebstore.google.com/detail/kfidecgcdjjfpeckbblhmfkhmlgecoff) |\n| `VUEJS_DEVTOOLS` | [Vue.js DevTools](https://chromewebstore.google.com/detail/nhdogjmejiglipccpnnnanhbledajbpd) |\n| `VUEJS_DEVTOOLS_BETA` | [Vue.js devtools (beta)](https://chromewebstore.google.com/detail/ljjemllljcmogpfapbkkighbhhppjdbg) |\n| `VUEJS_DEVTOOLS_V5` | [Vue.js devtools (v5)](https://chromewebstore.google.com/detail/hkddcnbhifppgmfgflgaelippbigjpjo) |\n| `VUEJS_DEVTOOLS_V6` | [Vue.js devtools (v6)](https://chromewebstore.google.com/detail/iaajmlceplecbljialhhkmedjlpdblhp) |\n\n### installExtension(extensionIds[, options])\n\ninstall chrome extension for electron\n\n- **extensionIds**: `string | string[]` - Chrome extension id\n- **options**: Install extension options\n  - _loadExtensionOptions_: [session.LoadExtensionOptions](https://www.electronjs.org/docs/latest/api/session#sesloadextensionpath-options)\n  - _forceDownload_: `boolean` - Force to download the extension even if it's already installed, default is `false`\n  - _source_: `'chrome' | 'unpkg' | 'jsdelivr' | 'npmmirror'` - Download url source. When the OS language is `zh_CN` , the default value is `npmmirror`, otherwise it is `chrome`.\n  - _session_: `'string' | 'Electron.Session'` - The target session on which the extension shall be installed, default is `session.defaultSession`.\n\nReturns `Promise\u003cElectron.Extension | Electron.Extension[]\u003e` - extension name/version, etc.\n\n### downloadExtension(extensionId[, options])\n\ndownload chrome extension for electron\n\n- **extensionId**: `string` - Chrome extension id\n- **options**: Download extension options\n  - _force_: `boolean` - Force to download the extension even if it's already installed, default is `false`\n  - _unzip_: `boolean` - Whether to unzip the downloaded file, default is `true`\n  - _attempts_: `number` - Number of attempts to download the extension, default is `5`\n  - _outPath_: `string` - The path to save the downloaded extension, default is `path.join(app.getPath('userData'), 'extensions')`\n  - _source_: `'chrome' | 'unpkg' | 'jsdelivr' | 'npmmirror'` - Download url source. When the OS language is `zh_CN` , the default value is `npmmirror`, otherwise it is `chrome`.\n\nReturns `Promise\u003c{ filePath: string; unzipPath?: string }\u003e`\n\n## Test/Debug\n\n```bash\npnpm jest --verbose false\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjs%2Felectron-devtools-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomjs%2Felectron-devtools-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomjs%2Felectron-devtools-installer/lists"}