JSPM

@eightnineight/intelhex-codec

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q31892F
  • License MIT

intel HEX format codec

Package Exports

  • @eightnineight/intelhex-codec
  • @eightnineight/intelhex-codec/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@eightnineight/intelhex-codec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

intelhex-codec

decode intel HEX format, and encode data to intel HEX format.

Install

npm install @eightnineight/intelhex-codec

Usage

import { intelhexCodec } from 'intelhex-codec';
import fs from 'fs/promises';

let file = await fs.open('./test.hex');
let inputString = await file.readFile();
const blocks = intelhexCodec.decode.fromString(inputString);
const hexString = intelhexCodec.encode.asString(blocks);
await fs.writeFile('./output.hex', hexString);
//Blocks format example
const blocks = [
    { // block 1
        address: address1, // block 1 data start address
        data: [...], // block 1 data
    },
    { // block 2
        address: address2, // block 2 data start address
        data: [...], // block 2 data
    },
    //...
];