{"_id":"@alcz/espefuse-js","_rev":"3-ad04e62d70c9bf86d035e31caa142e8e","name":"@alcz/espefuse-js","dist-tags":{"latest":"2.0.7"},"versions":{"2.0.2":{"name":"@alcz/espefuse-js","version":"2.0.2","keywords":[],"author":"","license":"ISC","_id":"@alcz/espefuse-js@2.0.2","maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"dist":{"shasum":"11c7024ddfeb8d07128abcdcf78899a85c498e46","tarball":"https://registry.npmjs.org/@alcz/espefuse-js/-/espefuse-js-2.0.2.tgz","fileCount":45,"integrity":"sha512-L6JmzwQbrfMz08tc/uEeWBq4J5nZ3upkc7DM/DuiwvZjshqAT+v+CL0cnFC9xy85OrzJ34SpQ8BCGFlw2lFvbg==","signatures":[{"sig":"MEQCIBL89/0fNDhYvFPNkMIpWgXRH1Gei0rhUv6N+WKaQoNhAiBj75DmgYYZcSqm7Lppd5ZWimCp7KbjQgArzs6DTxkKQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":532495},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"530b455880e46aa67c212ca2ab3bb468f07fd619","scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"npx nodemon","prepare":"tsc"},"_npmUser":{"name":"dgalalcz","email":"dgal@alps.cz"},"_npmVersion":"10.2.4","description":"Complementary lib to [esptool-js](https://github.com/espressif/esptool-js).","directories":{},"_nodeVersion":"18.18.0","dependencies":{"buffer":"^6.0.3","binascii":"^0.0.2","@types/node":"^20.11.24","@bitarray/es6":"^1.2.0","python-struct":"^1.1.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/espefuse-js_2.0.2_1713419643872_0.6776239916596389","host":"s3://npm-registry-packages"}},"2.0.6":{"name":"@alcz/espefuse-js","version":"2.0.6","license":"GPL-2.0","_id":"@alcz/espefuse-js@2.0.6","maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"homepage":"https://github.com/calcite/espefuse-js#readme","bugs":{"url":"https://github.com/calcite/espefuse-js/issues"},"dist":{"shasum":"b6856ce6ebe12418f83ab25cd850804aa56a0ab5","tarball":"https://registry.npmjs.org/@alcz/espefuse-js/-/espefuse-js-2.0.6.tgz","fileCount":31,"integrity":"sha512-lVVmKZImNP41E+SWbrFquNfRcwNGqk9iy/+wirWsyNu/5sfCU8TSt+erZgUU5RanBoqFhXz7vhlEtSQLuG+MYQ==","signatures":[{"sig":"MEUCIBeJwD8VnyeXnFlvxJW6sbVtsVyApRzStbw3fYADLybeAiEA4+p/nXFGaA9KrmkJKdPivRl7275MSALCf3e4Jn65Zqw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261293},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"3f94a0a9a63b6f6a2c1b4476745d08ad8f73e17a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"npx nodemon","prepare":"tsc"},"_npmUser":{"name":"dgalalcz","email":"dgal@alps.cz"},"repository":{"url":"git+https://github.com/calcite/espefuse-js.git","type":"git"},"_npmVersion":"10.5.0","description":"Complementary lib to [esptool-js](https://github.com/espressif/esptool-js).","directories":{},"_nodeVersion":"18.20.2","dependencies":{"buffer":"^6.0.3","binascii":"^0.0.2","@types/node":"^20.11.24","@bitarray/es6":"^1.2.0","python-struct":"^1.1.3"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/espefuse-js_2.0.6_1713431198931_0.7138547046530253","host":"s3://npm-registry-packages"}},"2.0.7":{"name":"@alcz/espefuse-js","version":"2.0.7","description":"Complementary lib to [esptool-js](https://github.com/espressif/esptool-js).","type":"module","scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"npx nodemon","prepare":"tsc"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","license":"GPL-2.0","repository":{"type":"git","url":"git+https://github.com/calcite/espefuse-js.git"},"dependencies":{"@bitarray/es6":"^1.2.0","@types/node":"^20.11.24","binascii":"^0.0.2","buffer":"^6.0.3","python-struct":"^1.1.3"},"devDependencies":{"typescript":"^5.3.3"},"_id":"@alcz/espefuse-js@2.0.7","gitHead":"912b840addf3ab922ab1152da39d4682fdd84416","bugs":{"url":"https://github.com/calcite/espefuse-js/issues"},"homepage":"https://github.com/calcite/espefuse-js#readme","_nodeVersion":"18.20.7","_npmVersion":"10.8.2","dist":{"integrity":"sha512-X7kTwzNQVgnSJlLZZnOqJwJkP8Dmzl2uVmZxTR5YTahkPKAMwKTvMJtfFyYvaYYvmQ3YqANvWrObI4QUH1p/OA==","shasum":"8698d05cb94630c7f2136da192100c17fcc837f7","tarball":"https://registry.npmjs.org/@alcz/espefuse-js/-/espefuse-js-2.0.7.tgz","fileCount":31,"unpackedSize":261297,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDWbC4PwUI1b7YhmSvF6NYS5epWKabqH5KkNiTGfcIwNgIgEQuBBiTy4H06Hs1zl74awueOYMKw5lZP83emSWo5A/Y="}]},"_npmUser":{"name":"dgalalcz","email":"dgal@alps.cz"},"directories":{},"maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/espefuse-js_2.0.7_1743764165044_0.3881886653903317"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-18T05:54:03.754Z","modified":"2025-04-04T10:56:05.390Z","2.0.2":"2024-04-18T05:54:04.077Z","2.0.6":"2024-04-18T09:06:39.098Z","2.0.7":"2025-04-04T10:56:05.230Z"},"bugs":{"url":"https://github.com/calcite/espefuse-js/issues"},"license":"GPL-2.0","homepage":"https://github.com/calcite/espefuse-js#readme","repository":{"type":"git","url":"git+https://github.com/calcite/espefuse-js.git"},"description":"Complementary lib to [esptool-js](https://github.com/espressif/esptool-js).","maintainers":[{"name":"dgalalcz","email":"dgal@alps.cz"}],"readme":"## Javascript implementation of espefuses\n\nComplementary lib to [esptool-js](https://github.com/espressif/esptool-js).\n\n**Only the esp32s3 variant is partially supported.**\n\nNo read/write file operation is implemented (burnKey input values, emulator output..).\n\n---\n\n`argparse` (parsing cmd line arguments) part of esptool is not implemented.\n\n(Only burnEfuse operation is performing the ArgValue check - e.g. transform MAC address in string format to binary representation..)\n\n---\n\n#### usage\n\nwebpack example\n\n```javascript\nimport { ESPLoader, LoaderOptions, Transport } from \"esptool-js\";\nimport { getEfuses, getEspEmulator } from \"@alcz/espefuse-js\";\n\n// same as term in esptool-js\nconst espLoaderTerminal = {\n   // xterm-js or any other output\n   clean() {\n      terminal.clear();\n   },\n   writeLine(data) {\n      terminal.writeln(data);\n   },\n   write(data) {\n      terminal.write(data);\n   },\n};\n\nconst main = async () => {\n   // esptool\n   const dev = await this.getDevice();\n   const transp = new Transport(dev, true);\n\n   const loaderOptions: LoaderOptions = {\n            transport: transp,\n            baudrate: 115200,\n            terminal: espLoaderTerminal,\n            enableTracing: false,\n         };\n   const espLoader = new ESPLoader(loaderOptions);\n   // or use emulator\n   // const espLoader = new (getEspEmulator())();\n\n   // espefuses\n   const efuseOptions = {\n            esp: espLoader,\n            skipConnect: false,\n            debug: true,\n            doNotConfirm: true,\n            terminal: this.espLoaderTerminal\n         };\n\n   const [efuses, operations] = getEfuses(efuseOptions);\n   await efuses.setup();\n\n   // print efuses summary\n   await operations.summary(espLoader, efuses, {format: \"summary\"});\n}\n\nmain();\n\n```\n\n#### EspEfuses settings:\n\n - esp: esptool-js instance\n - skipConnect: `boolean = false` (assume esptool-js instance is connected if `true`)\n - debug: `boolean = false`\n - doNotConfirm: `boolean = false` (not-confirm burn op?)\n - terminal = `null`; same as in esptool-js\n - confirmFn = `null`; Confirmation function. Return `true` to confirm or raise Error to deny.\n\n#### operations\n\nList of implemented operations:\n\n```\nargs used in all ops:\nesp: ESPLoader insance\nefuses: EspEfuses instance\n```\n\n---\n\n - **summary** `async function summary(esp: any, efuses: any, args: any): Promise<void>`\n\n    args: `{format: \"summary\"}` for human readable format\n\n - **burnBit** `async function burnBit(esp: any, efuses: any, args: any): Promise<void>`\n\n\n    ```\n    args:\n    block: blockName, - Efuse block to burn [string - BLOCK0,BLOCK1,BLOCK2,BLOCK3]\n    bitNumber: bitNum - Bit number in the efuse block [0..BLK_LEN-1]\n    ```\n\n - **burnEfuse** `async function burnEfuse(esp: any, efuses: any, args: any): Promise<void>`\n\n\n    ```\n    args:\n    nameValuePairs: [{[efuseName]: efuseValue}, ...]\n    ```\n\n - **readEfuse** `async function readEfuse(esp: any, efuses: any, args: any)`\n\n   ```\n   args:\n   efuses: list of efuse names to read [efuseName, ..]\n   ```\n\n   returns dict `{[efuseName]: value, ...}`\n\n - **writeProtectEfuse** `async function writeProtectEfuse(esp: any, efuses: any, args: any): Promise<void>`\n\n   ```\n   args:\n   efuseName: list of efuse names to write protect [efuseName, ...]\n\n   ```\n\n - **burnKey** `async function burnKey(esp: any, efuses: any, args: any, digest: any = null): Promise<void>`\n\n   ```\n   args:\n   keypurpose: list of key purpose [TODO?: support \"XTS_AES_256_KEY\"]\n   block: block name list\n   keyfile: list of files to read block data from. (not supported, TODO?)\n   forceWriteAlways: [boolean]\n   noWriteProtect: [boolean]\n\n   digest: list of data keys to burn\n   ```\n\n   If `keyfile` is not set, `digest` is used instead as source for data to burn.\n\n   Number of items in `block`, `keypurpose`, and `keyfile` / `digest` must be the same.\n\nOperations can be emulated for debugging purposes.\n\n### License\n\nThis document and the attached source code are released as Free Software under GNU General Public License Version 2 or later. See the accompanying [LICENSE file](https://github.com/calcite/espefuse-js/blob/master/LICENSE) for a copy.\n","readmeFilename":"README.md"}