Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example #1

Open
jdriesen opened this issue Dec 21, 2019 · 3 comments
Open

Example #1

jdriesen opened this issue Dec 21, 2019 · 3 comments

Comments

@jdriesen
Copy link

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
Copy link

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

@fabianpoels
Copy link

fabianpoels commented Nov 14, 2020

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
Copy link
Author

Thank you, Fabian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants