npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zkteco-js

v1.7.0

Published

The zkteco library allows Node.js developers to easily interface with ZK BioMetric Fingerprint Attendance Devices, extract and manage data, and integrate biometric features into attendance systems efficiently.

Downloads

181

Readme

Warning

⚠️ This repository is not recommended for use in production. ⚠️

This repository is currently in development and may contain bugs or incomplete features. Use at your own risk and do not deploy to a production environment.

About zkteco-js

The zkteco-js library provides a robust solution for Node.js developers to interface with ZK BioMetric Fingerprint Attendance Devices. Its user-friendly API allows seamless extraction of data, such as registered users, logs, and device versions. Developers can also add users, retrieve real-time logs, and clear attendance records. Using a socket connection, the library ensures fast and reliable data exchange. Whether creating an attendance system or a time-and-attendance management application, zkteco-js is the essential tool for integrating biometric devices efficiently.

Installation

npm i zkteco-js

Or, if you prefer Yarn:

yarn add zkteco-js

Usage Example

const Zkteco = require("zkteco-js");

const manageZktecoDevice = async () => {
    const device = new Zkteco("192.168.1.106", 4370, 5200, 5000);

    try {
        // Create socket connection to the device
        await device.createSocket();

        // Retrieve and log all attendance records
        const attendanceLogs = await device.getAttendances();
        console.log(attendanceLogs);

        // Listen for real-time logs
        await device.getRealTimeLogs((realTimeLog) => {
            console.log(realTimeLog);
        });

        // Manually disconnect after using real-time logs
        await device.disconnect();
    } catch (error) {
        console.error("Error:", error);
    }
};

manageZktecoDevice();

API Reference :

  • createSocket() - Establishes a connection to the device.
  • getInfo() - Provides general information about the device, including log capacity and user count.
  • getUsers() - Retrieves an array of all users stored on the device.
  • setUser(uid, userid, name, password, role = 0, cardno = 0) - Adds a new user to the device.
  • 🆕 deleteUser(uid) - Delete an user from the device.
  • getAttendances() - Retrieves an array of all attendance logs from the device.
  • getRealTimeLogs(callback) - Sets up a real-time log stream and calls the provided callback function with each new log entry.
  • getPIN() - Retrieves the device PIN.
  • getTime() - Retrieves the current time from the device.
  • 🆕 setTime(DateTime) - Updates the device's time.
  • getFaceOn() - Checks if the device's Face On feature is enabled.
  • getSSR() - Retrieves the device's Self-Service Recorder (SSR) status.
  • getDeviceVersion() - Retrieves the device's firmware version.
  • getDeviceName() - Retrieves the device's name.
  • getPlatform() - Retrieves the device's platform version.
  • getOS() - Retrieves the device's operating system version.
  • getAttendanceSize() - Retrieves the total number of attendance records stored on the device.
  • clearAttendanceLog() - Clears all attendance logs from the device.
  • disconnect() - Disconnects the device from the network.
  • 🆕 clearData() - Clear All Data from the device (all users,attendances logs etc ).
  • 🆕 voiceTest() - Voice Test.
  • 🆕 getVendor() - get vendor name.
  • 🆕 getProductTime() - get product created time.
  • 🆕 getMacAddress() - get device MAC address.

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.

Alternatives

License

The MIT License (MIT). Please see License File for more information.