{"id":14963151,"url":"https://github.com/espressif/esptool-js","last_synced_at":"2025-05-14T20:02:00.445Z","repository":{"id":40387346,"uuid":"377482776","full_name":"espressif/esptool-js","owner":"espressif","description":"Javascript implementation of flasher tool for Espressif chips, running in web browser using WebSerial.","archived":false,"fork":false,"pushed_at":"2025-03-18T11:00:11.000Z","size":1287,"stargazers_count":340,"open_issues_count":29,"forks_count":117,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-06T13:04:32.955Z","etag":null,"topics":["esp32","esptool","webserial"],"latest_commit_sha":null,"homepage":"https://espressif.github.io/esptool-js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/espressif.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-06-16T12:06:46.000Z","updated_at":"2025-04-05T02:02:13.000Z","dependencies_parsed_at":"2023-10-12T23:13:35.703Z","dependency_job_id":"bea03120-3d77-4342-a73f-c572cf81f582","html_url":"https://github.com/espressif/esptool-js","commit_stats":{"total_commits":140,"total_committers":17,"mean_commits":8.235294117647058,"dds":0.6285714285714286,"last_synced_commit":"beafdc650eb8a4f10d4ac56a5ee5c56102fe671c"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espressif%2Fesptool-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espressif%2Fesptool-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espressif%2Fesptool-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/espressif%2Fesptool-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/espressif","download_url":"https://codeload.github.com/espressif/esptool-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741145,"owners_count":21154251,"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":["esp32","esptool","webserial"],"created_at":"2024-09-24T13:31:05.394Z","updated_at":"2025-04-13T15:56:26.517Z","avatar_url":"https://github.com/espressif.png","language":"TypeScript","readme":"# Javascript implementation of esptool\n\nThis repository contains a Javascript implementation of [esptool](https://github.com/espressif/esptool), a serial flasher utility for Espressif chips. `esptool-js` is based on [Web Serial API](https://wicg.github.io/serial/) and works in Google Chrome and Microsoft Edge [version 89 or later](https://developer.mozilla.org/en-US/docs/Web/API/Serial#browser_compatibility) browsers and Google Chrome on Android [version 61 or later](https://developer.mozilla.org/en-US/docs/Web/API/USB#browser_compatibility) via the [web-serial-polyfill](https://github.com/google/web-serial-polyfill) compatibility layer.\n\n**NOTE:** Unlike the Python-based esptool, `esptool-js` doesn't implement generation of binary images out of ELF files, and doesn't include companion tools similar to [espefuse.py](https://github.com/espressif/esptool/wiki/espefuse) and [espsecure.py](https://github.com/espressif/esptool/wiki/espsecure).\n\n## Usage\n\n**CDN**\n\n`https://unpkg.com/esptool-js/lib/index.js` or `https://unpkg.com/esptool-js/bundle.js` to use the single bundle JavaScript file.\n\n**NPM**\n\n`npm install --save esptool-js`\n\n**Yarn**\n\n`yarn add --save esptool-js`\n\nCheck an example project [here](https://github.com/espressif/esptool-js/tree/main/examples/typescript).\n\n**Nightly builds** for \u003ca href=\"https://nightly.link/espressif/esptool-js/workflows/ci/main\"\u003eESPTOOL-JS\u003c/a\u003e\n\n## Define port filters for device using WebSerial\n\n```js\nconst portFilters: { usbVendorId?: number | undefined, usbProductId?: number | undefined }[] = [];\nconst device = await navigator.serial.requestPort({ filters: portFilters });\n```\n\n## Inject a Terminal to use with esptool-js\n\n```js\n// You can use any JavaScript compatible terminal by wrapping it in a helper object like this:\nlet espLoaderTerminal = {\n  clean() {\n    // Implement the clean function call for your terminal here.\n  },\n  writeLine(data) {\n    // Implement the writeLine function call for your terminal here.\n  },\n  write(data) {\n    // Implement the write function call for your terminal here.\n  },\n};\n```\n\nYou can pass this terminal object to `ESPLoader` constructor as shown in the [examples projects](./examples/).\n\n## Live demo\n\nVisit https://espressif.github.io/esptool-js/ to see this tool in action.\n\n## Testing it locally\n\n```sh\nnpm install\nnpm run build\ncd examples/typescript\nnpm install\nnpm run dev # Run local sever with example code\n```\n\nThen open `http://localhost:1234` in a Chrome browser. The `npm run build` step builds the `lib` used in the example `examples/typescript/index.html`. Update this reference as described in [Usage](#usage) section.\n\n## Test from Pull Request artifact\n\nIf you are testing the main branch or any Pull Request (PR) artifact you can follow these steps:\n\n1. Get the `esptool-js-\u003cversion\u003e.tgz` where `\u003cversion\u003e` is the current version and download it.\n2. Add the following line to your project's package.json dependencies\n\n```json\n\"dependencies\": {\n  \"esptool-js\": \"file:../path/to/esptool-js-\u003cversion\u003e.tgz\"\n}\n```\n3. Use the package like `import \"esptool-js/lib/index.js\"` when added in package.json as shown before.\n\n## License\n\nThe code in this repository is Copyright (c) 2023 Espressif Systems (Shanghai) Co. Ltd. It is licensed under Apache 2.0 license, as described in [LICENSE](https://github.com/espressif/esptool-js/blob/main/LICENSE) file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespressif%2Fesptool-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fespressif%2Fesptool-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fespressif%2Fesptool-js/lists"}