bill-validator

0.8.1 • Public • Published

bill-validator

A Node.js library to facilitate the use of bill validators.

Supported Validators

PR are welcome

Getting started

Installation

Using yarn

$ yarn add bill-validator

Using npm

$ npm i --save bill-validator

Usage

'use strict'
 
const {createApex7000, createSerialInterface} = require('bill-validator')
 
const main = async () => {
    // Create a IO Interface
    const serialInterface = createSerialInterface({
        port: '/dev/ttyUSB0'
        , portOptions: {
            autoOpen: false
            , baudRate: 9600
            , dataBits: 7
            , parity: 'even'
            , stopBits: 1
        }
    })
 
    // Create the Bill validator
    const apex7000 = createApex7000({
        ioInterface: serialInterface
    })
 
 
    // Listen for events
    apex7000.onAny((event, value) => {
        console.log({[event]: value})
    })
 
    // Start
    await apex7000.start()
 
    // Accept
    apex7000.accept()
}
 
main()

Contributing

Style

My style is a bit unorthodox and has evolved over 20 years of development. It's not what the cool kids are doing but hey, you might like it!

eslint-config-ayotte

Process

  1. Write test
  2. Write code
  3. Assure that there are not test or lint errors
  4. Submit PR

License

MIT

Package Sidebar

Install

npm i bill-validator

Weekly Downloads

1

Version

0.8.1

License

MIT

Unpacked Size

239 kB

Total Files

22

Last publish

Collaborators

  • richayotte