JubaerHossain / zk-jubaer

zk-jubaer is a Node.js library that provides a simple and intuitive API for interacting with ZK BioMetric Fingerprint Attendance Devices. It enables developers to retrieve device information, add new users, retrieve real-time logs, and clear the attendance logs stored on the device
21 stars 5 forks source link
attendance-system biometrics fingerprint realtime realtime-attendance socket-io zkteco

zk-jubaer

The zk-jubaer library is a powerful tool for Node.js developers who need to integrate their applications with ZK BioMetric Fingerprint Attendance Devices. With its simple and intuitive API, developers can easily retrieve information from the device, such as the number of users registered, logs, device version, and more. It also enables developers to add new users, retrieve real-time logs, and clear the attendance logs stored on the device. The library uses a socket connection to communicate with the device, which provides fast and reliable data transfer. Whether you need to build an attendance tracking system, a time-and-attendance management solution, or any other application that requires integration with biometric devices, the zk-jubaer library is the perfect tool to get the job done.

Installation

npm i zk-jubaer

Or, if you prefer Yarn:

yarn add zk-jubaer

Usage Example

const ZKJUBAER = require("zk-jubaer");

const runMachine = async () => {
  let obj = new ZKJUBAER("192.168.1.106", 4370, 5200, 5000);
  try {
    // Create socket to machine
    await obj.createSocket();

    // Get all logs in the machine
    const logs = await obj.getAttendances();
    console.log(logs);

    // Read real-time logs
    await obj.getRealTimeLogs((data) => {
      console.log(data);
    });

    // Disconnect from device
    await obj.disconnect(); // when you are using real-time logs, you need to disconnect manually
  } catch (e) {
    console.log(e);
  }
};

runMachine();

API Reference :

Don't forget to star the repo if you like it.