anthonykirby / lora-packet

LoRa radio packet decoder
MIT License
258 stars 83 forks source link

How to use the library with TypeScript ESM? #109

Open jeanmatthieud opened 11 months ago

jeanmatthieud commented 11 months ago

Hi,

I'm trying to use the library with a node ESM package. I'm sure that I'm missing something, but I cannot make lora-packet work with ESM and TypeScript.

Could it be possible to create an ESM release of lora-packet ?

diegofcornejo commented 9 months ago

@jeanmatthieud just import like ESM

import * as lorapacket from 'lora-packet';
const packet = lorapacket.fromWire(Buffer.from('your-buffer-data', 'hex'));