{"_id":"@9wick/esptool.js","_rev":"3-0d060a9cde2363b53dbbc04b80b4c5a2","name":"@9wick/esptool.js","dist-tags":{"latest":"0.9.5"},"versions":{"0.9.1":{"name":"@9wick/esptool.js","version":"0.9.1","description":"TypeScript/Nodejs port of the esptool","main":"build/index.js","types":"build/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/9wick/esptool.js.git"},"author":{"name":"9wick","url":"forked from Toitware ApS"},"license":"MIT","scripts":{"build":"tsc -b tsconfig.json","watch":"tsc -b tsconfig.json -w","clean":"tsc -b tsconfig.json --clean","lint":"eslint 'src/*.{js,ts,tsx}' --max-warnings=0","doc":"typedoc","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":["esptool","webserial","esp32","esp8266","serial","toit","toitware"],"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.2.3","prettier":"^2.3.1","typedoc":"^0.21.0","typescript":"^4.3.4"},"dependencies":{"@types/node":"^16.11.7","@types/serialport":"^8.0.2","serialport":"^9.2.5"},"gitHead":"0b5486332650b56d4d78feaba161825ed9a5a255","bugs":{"url":"https://github.com/9wick/esptool.js/issues"},"homepage":"https://github.com/9wick/esptool.js#readme","_id":"@9wick/esptool.js@0.9.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-UtU8WgD4WzGT8u+xHIzqKIHWWELvz0pgOkl3pR3xcOOPadsMIy9ruQWoXHo2MffHnMk8OF9QLy7ptw4NEQ63qA==","shasum":"8d70aaad67fa39085d8cef7589e4f506a0c187b2","tarball":"https://registry.npmjs.org/@9wick/esptool.js/-/esptool.js-0.9.1.tgz","fileCount":31,"unpackedSize":110107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk1V1CRA9TVsSAnZWagAAVUkP/3unZl0rAdEjXURaOqPb\nF75JnfY4FcA9ZCVxe/fHCydyG2R2XqBoQduNztFbKYym2PcMGDWUY/OKCqJ9\ny6JmIN96fRacNcYqMAyWMM0z0tJ7vqiUPWPsXVYi3pJJ3P9HkzW4VwqyELFL\nJyTv5ILIQPQJmjP717Ez4bkummdBeOoZWV2s3xf2hjrla03HdhfjzOPZDDn7\n/bq9XwgVb1yC2FO6gWZcn6BnkeDA19OpLS9+Rvf4WzRHE2ik2rVBu02QyYPn\n4jQcQtZsVqp0KaelouYe/OLNvwpjkTAGx77gIdZi0GZIEAEP9rCe5nT/FCOj\nTRexClgH/lfDPTUuCc8XlCDie9xT3n3ES44btywWuYgrR3Aczh1bBHyFfR5k\nRV+WZrv9PqpKgD6ZDqfMuS+A2bdcxiS1pegkLb3oHVBNNbDjxg2esMcc2GPY\nd0MmFqSwLZSjDqnMbZ3ledZ1FOAVqjbAhmDS711DOly66w+S6qKyyutG6vkl\nO+MctLjPEg2ahpQuIc16MtI8Fj8o2faLQd8Q+pl1BHEQaxLKJcO1YIdle/sm\n/oDIr4B5+yxf8wUiFoi8FlQpVmx293O68v0H4y1aEZzsdiStQyEjLI+RiW+E\nWXg3i5Gcmkiqs44p6Eukw4/gaf44p10lLEotbv8emjZI4sZclFLkOyEQosQ3\nOaHU\r\n=lr7b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEl4PDZm2xS+DEGqDeHcNKuvs8WVhqB780GkwlPsd8h8AiA0vkZ1MjrLmWyb9u8+FsHXMl+NNZGsNLMkRdzwFKX2VQ=="}]},"_npmUser":{"name":"kido","email":"kido@9wick.com"},"directories":{},"maintainers":[{"name":"kido","email":"kido@9wick.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esptool.js_0.9.1_1637045620886_0.04383984842420352"},"_hasShrinkwrap":false},"0.9.3":{"name":"@9wick/esptool.js","version":"0.9.3","description":"TypeScript/Nodejs port of the esptool","main":"build/index.js","types":"build/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/9wick/esptool.js.git"},"author":{"name":"9wick","url":"forked from Toitware ApS"},"license":"MIT","scripts":{"build":"tsc -b tsconfig.json","watch":"tsc -b tsconfig.json -w","clean":"tsc -b tsconfig.json --clean","lint":"eslint 'src/*.{js,ts,tsx}' --max-warnings=0","doc":"typedoc","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":["esptool","webserial","esp32","esp8266","serial","toit","toitware"],"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.2.3","prettier":"^2.3.1","typedoc":"^0.21.0","typescript":"^4.3.4"},"dependencies":{"@types/node":"^16.11.7","@types/serialport":"^8.0.2","serialport":"^9.2.5","wtfnode":"^0.9.1"},"gitHead":"cff8ecea393d4a87ffae39df57c2fae717d89b42","bugs":{"url":"https://github.com/9wick/esptool.js/issues"},"homepage":"https://github.com/9wick/esptool.js#readme","_id":"@9wick/esptool.js@0.9.3","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-qFg2QoMg2T2YlzI/iTIzJuOXc9z3ZtD6L6kkFLAvhCQcq8wZlgqx5isaO9EntaOhpHtHnOgr4hwuYKeUdKViGQ==","shasum":"4e235e0ca3b5e5f8a32674b17466f2913e3616ad","tarball":"https://registry.npmjs.org/@9wick/esptool.js/-/esptool.js-0.9.3.tgz","fileCount":31,"unpackedSize":110947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk1/MCRA9TVsSAnZWagAAmOYP+gMtZQ+K8qhZTbiK/271\nfZJZFrifEx+5A/E7kBsY2a9QjdwhB5Ehubz/jeh3zJfz0FLTfupVFNnL6FqK\nJLW4FEyC0FSmkpuN94gEkJQy+GmERgKlNSqgx5PRLXRVoQY1QgiuMT9AVXmq\nbHcB7qu/87aQCsx2plXc5XlU/lJPmak3gXdWhtVUwSTWKvMHz3s3d3IT2T5i\n2hwFHV7+FVFK0lbGv6AQqmV9W5zcUSZXLBAFd79yvGiRtfyakyIFm2L9o+dQ\n43Aw4kcv2ycapbzAX76nlMOHv+96q7yrZ0s05ovlie++XvK7Vyo8v74zbxTS\n0iLp1mvyFf4I+PaQUSzZ4qAezGWja6lmijWtuaFSN1zI2lsOviJhXxBk6Bli\nf/AZ+ZMQCPWqa9iawQzdM2SzOUZBiAczPcI/ckQDUlhk01uvVF0AFl06eVQh\nERBFhFOE2DfsUX2qujEISiiwcnsMua9xMyQ9fzvCEPU6+gVTeiMjJ5jF3KO5\nhqTpp42HFAXXG/g4fGa6/flWDZufznVytwjKmTMoYcUUBr1P8ZosvAtUxTCm\n7e8kM3DrP5BMqX/ABB+GZbzI7iJ/zAa08oU1v9mbFzuCu3x6MP3rWbC2M/no\n6HFbVsqpuoMCfEOL5XOoTNfTbnq72M/28fb4q/ArvofXYurBeMKW1RoRxxv4\npAgX\r\n=Y6ku\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjqygSfiVH5Mc3JkpatEm4hY9bc3jzoRz1CQ3JBQlSnAiBtvknIWLL5cTxLx03OLgyJUh5laVo8XO3DndU42UBnog=="}]},"_npmUser":{"name":"kido","email":"kido@9wick.com"},"directories":{},"maintainers":[{"name":"kido","email":"kido@9wick.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esptool.js_0.9.3_1637048268675_0.06411160438696806"},"_hasShrinkwrap":false},"0.9.5":{"name":"@9wick/esptool.js","version":"0.9.5","description":"TypeScript/Nodejs port of the esptool","main":"build/index.js","types":"build/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/9wick/esptool.js.git"},"author":{"name":"9wick","url":"forked from Toitware ApS"},"license":"MIT","scripts":{"build":"tsc -b tsconfig.json","watch":"tsc -b tsconfig.json -w","clean":"tsc -b tsconfig.json --clean","lint":"eslint 'src/*.{js,ts,tsx}' --max-warnings=0","doc":"typedoc","typecheck":"tsc -p tsconfig.json --noEmit"},"keywords":["esptool","webserial","esp32","esp8266","serial","toit","toitware"],"devDependencies":{"@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.2.3","prettier":"^2.3.1","serialport":"^9.2.7","typedoc":"^0.21.0","typescript":"^4.3.4"},"dependencies":{"@types/node":"^16.11.7","@types/serialport":"^8.0.2","wtfnode":"^0.9.1"},"gitHead":"bc5db3edd2b1bfe5603e2328e83fdbc19424c5c1","bugs":{"url":"https://github.com/9wick/esptool.js/issues"},"homepage":"https://github.com/9wick/esptool.js#readme","_id":"@9wick/esptool.js@0.9.5","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-wIia8k9DA49ETRF8d1n/2T9lgrc8jOa/70X8PNKIPs1d4iXwcPdg7WKrT8uvvbB184ZLLJpJlmrBur03YH0t+A==","shasum":"1288f0edf31adef9a5c1c1bfa30536bf319c35b1","tarball":"https://registry.npmjs.org/@9wick/esptool.js/-/esptool.js-0.9.5.tgz","fileCount":31,"unpackedSize":110947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnwmlCRA9TVsSAnZWagAAUwsP/3fv3YWAQCB9O3HoVXCW\nN6rgabbnRqHjxv/oaz/D++2hHsu3LzAXSBUwwil8+CRw18XVbjE6jzFVPvKZ\nekr236vxoQReKpDASmCHMUIiHhCkzmg7uooDvh/HfSLEmAr71s8rivo96Uwh\n6xVAFO51kV3lb4eFRoyTQOP0x4/Tge+/3olT683TTrZ4tY/2MeyIcbQPJQgz\nl1B9AYGbhUzrxSt1UWdUtNvSXeR3bnoG+u53YZqb4TwujS7V67V1bY/+odbt\ny+TyCqtBJgLW6byv8f1NEiAKcin9jn3jbSPncLmsy0vZqX3jCX7AHnAwN0pb\nz/pjDi4/uM7BFGUL7H5d+sSESsEykH+dYda9tB0t/XeCC5fRhJg7dp23f7QJ\nINw5CX7WSM3lrzM75lqOFL9IolR0OFvbeljKr2/gkysllAxJHBr+/jB91uee\nh+e4G9lPa6YTwlIGDYB8MhD3gRgTpIrCPgqSmk6nGLIE+zFWVMbQI2WMc5bh\nvF4m8SeM5pIMYrLfle/ed8wD/0EzbtXZhl88sj238pxkRAX+aK6lQbxzwcDd\nRVJip9zbtf7EacL/RX4laOCTUiMfEBtuk33BuMbiL9PaFO9EHnQgW16mpH+m\nKxNQ6kmCVsocneOyi4KK4eEvb5r8kKN7aLqixxTtsgg/Y5MnHXXj0n9oVth4\nQiCe\r\n=kUWR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBV4L6qTrN/t5afNE5RixGZfDszT1mwx1VBbAoWqdFnpAiEA2RjthFAvGqTrcT3XYEGCILZBS3/ovH/+5cuZyu/oY6M="}]},"_npmUser":{"name":"kido","email":"kido@9wick.com"},"directories":{},"maintainers":[{"name":"kido","email":"kido@9wick.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esptool.js_0.9.5_1637812645097_0.9381588501746196"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-16T06:53:40.814Z","0.9.1":"2021-11-16T06:53:41.053Z","modified":"2022-04-04T10:51:21.229Z","0.9.3":"2021-11-16T07:37:48.831Z","0.9.5":"2021-11-25T03:57:25.234Z"},"maintainers":[{"name":"kido","email":"kido@9wick.com"}],"description":"TypeScript/Nodejs port of the esptool","homepage":"https://github.com/9wick/esptool.js#readme","keywords":["esptool","webserial","esp32","esp8266","serial","toit","toitware"],"repository":{"type":"git","url":"git+ssh://git@github.com/9wick/esptool.js.git"},"author":{"name":"9wick","url":"forked from Toitware ApS"},"bugs":{"url":"https://github.com/9wick/esptool.js/issues"},"license":"MIT","readme":"# esptool.js\n\n[![npm](https://img.shields.io/npm/v/@toit/esptool.js.svg?style=flat-square)](https://www.npmjs.org/package/@toit/esptool.js)\n[![npm](https://img.shields.io/npm/l/@toit/esptool.js.svg?style=flat-square)](https://www.npmjs.org/package/@toit/esptool.js)\n[![typedoc](https://img.shields.io/badge/-typedoc-blue?style=flat-square)](https://toitware.github.io/esptool.js)\n[![GitHub](https://img.shields.io/github/stars/toitware/esptool.js.svg?style=flat-square)](https://github.com/toitware/esptool.js)\n\n\nTypeScript port of the esptool.\n\nThe [esptool](https://github.com/espressif/esptool) is originally written in python, and we have here ported it to TypeScript.\n\nThis implementation is used in the [Toit Console](https://console.toit.io) to allow users to flash and monitor ESP32:\n\n[![Flash ESP32 with web serial](https://img.youtube.com/vi/ZsD59Tg2oCQ/0.jpg)](https://www.youtube.com/watch?v=ZsD59Tg2oCQ)\n\nBlog post on why we started this project: [Flash your ESP32 from the browser using Web Serial](https://blog.toit.io/flash-your-esp32-from-the-browser-using-web-serial-5eccb1483b9c).\n\n## Example\n\nThe code is written as a library, here is an examples showcasing how you can flash an ESP32 using the library:\n\n```typescript\nexport type Partition = {\n  name: string;\n  data: Uint8Array;\n  offset: number;\n};\n\n// TODO: Here you have to specify the partitions you want to flash to the ESP32.\nconst partitions: Partition[] = [];\n\nconst port = new EsptoolSerial(\"/dev/tty.SLAB_USBtoUART\", {\n  baudRate: 115200,\n  autoOpen: false,\n});\nawait port.open();\ntry {\n  const loader = new EspLoader(port, { debug: true, logger: console });\n  options.logger.log(\"connecting...\");\n  await loader.connect();\n  try {\n    options.logger.log(\"connected\");\n    options.logger.log(\"writing device partitions\");\n    const chipName = await loader.chipName();\n    const macAddr = await loader.macAddr();\n    await loader.loadStub();\n    await loader.setBaudRate(options.baudRate, 921600);\n\n    if (options.erase) {\n      options.logger.log(\"erasing device flash...\");\n      await loader.eraseFlash();\n      options.logger.log(\"successfully erased device flash\");\n    }\n\n    for (let i = 0; i < partitions.length; i++) {\n      options.logger.log(\"\\nWriting partition: \" + partitions[i].name);\n      await loader.flashData(partitions[i].data, partitions[i].offset, function (idx, cnt) {\n        if (options.progressCallback) {\n          options.progressCallback(partitions[i].name, idx, cnt);\n        }\n      });\n      await sleep(100);\n    }\n    options.logger.log(\"successfully written device partitions\");\n    options.logger.log(\"flashing succeeded\");\n  } finally {\n    await loader.disconnect();\n  }\n} finally {\n  await port.close();\n}\n```\n\n## Development\nTo have automatic checks for copyright and MIT notices, run\n\n```\n$ git config core.hooksPath .githooks\n```\n\nIf a file doesn't need a copyright/MIT notice, use the following to skip\nthe check:\n```\ngit commit --no-verify\n```\n\n## Similar projects\n\n* [Espressif esptool-js](https://github.com/espressif/esptool-js): new project with similar purpose, but still not written as a proper library.\n\n* [Adafruit Adafruit ESPTool](https://github.com/adafruit/Adafruit_WebSerial_ESPTool): the source of inspration for us, big shout-out thanks for spearheading the effort. The implementation is written as a application and hard to use as a library.\n","readmeFilename":"README.md"}