modeclerck / belgium-eid

Belgium eID Card Reader for NodeJs
7 stars 7 forks source link

Example #1

Open jdriesen opened 4 years ago

jdriesen commented 4 years ago

Hi,

Thanks for providing this source-code.

I'm a Node Newbie, and it is not 100% clear to me how to use your code.

So, can I kindly ask to add a small example please ? (e.g.: showing the eID card information via console.log)

That would be a great help !

Thanks in advance,

Johnny Driesen

anonymousdplantgit commented 4 years ago

Hello, I'm in the same situation as @jdriesen , could you please provide a simple example. Many thanks.

fabianpoels commented 4 years ago

First: require the lib in your project const eid = require('belgium-eid')

Next, create a reader const reader = eid()

Start listening to card inserts reader.on('card-inserted', card => { console.log(card) })

and add some error handling: reader.on('error', (reader, error) => { console.log(error) })

Note that there is more data available on the card than is used in this library.

jdriesen commented 4 years ago

Thank you, Fabian.