node-zklib
- install
npm install --save node-zklib
or yarn add node-zklib
const ZKLib = const test = async { let zkInstance = '10.20.0.7' 4370 10000 4000; try // Create socket to machine await zkInstance // Get general info like logCapacity, user counts, logs count // It's really useful to check the status of device console catch e console if ecode === 'EADDRINUSE' // Get users in machine const users = await zkInstance console // Get all logs in the machine // Currently, there is no filter to take data, it just takes all !! const logs = await zkInstance console const attendances = await zkInstance // YOu can also read realtime log by getRealTimelogs function // console.log('check users', users) zkInstance // delete the data in machine // You should do this when there are too many data in the machine, this issue can slow down machine zkInstance; // Disconnect the machine ( don't do this when you need realtime update :))) await zkInstance }
-
There are many function you can do just visit zk protocol to see the command and put it in executeCmd function already exist in the ZKLIB
async { return await this } // unlock the door