bitcoinjs / bolt11

A library for encoding and decoding lightning network payment requests as defined in BOLT #11.
MIT License
92 stars 64 forks source link

Add 'bolt11 decode' command as excutable #63

Open grunklejp opened 1 year ago

grunklejp commented 1 year ago

Is there any interest in exposing any of the payreq.js's exports as executables?

I've found my self regularly opening a node repl then calling require('bolt11').decode(<invoice>) and thought it might be nice to add this small functionality to this lib. It's also nice to be able to easily pipe this into jq or other shell tools.

This PR only exposes the decode command but i'd be happy to do the rest if there is interest for them, although I do suspect decode is the most useful in this context.

To test this out yourself pull down my branch and run

 $ npm link
$ bolt11 decode <invoice>