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 🙏

© 2026 – Pkg Stats / Ryan Hefner

zklib-js-zkteko

v1.3.4

Published

Improved JavaScript library for working with ZKTeco biometric attendance devices

Readme

zklib-js-zkteko

📦 Mejorada librería Node.js para conectarse a dispositivos biométricos ZKTeco (Asistencia y Huellas) vía UDP.

Esta es una versión mejorada del proyecto original zklib-js, con mejoras en compatibilidad, manejo de errores y nuevas funciones para dispositivos de control de asistencia.


✨ Características

  • Conexión vía UDP a dispositivos ZKTeco (modelos compatibles con ZKLib)
  • Obtención de registros de asistencia
  • Listado de usuarios
  • Manejo de fechas desde/hasta
  • Compatibilidad con múltiples modelos
  • Mejor manejo de desconexiones y errores

📦 Instalación

npm install zklib-js-zkteko

🚀 Uso Básico

const ZKLib = require('zklib-js-zkteko');

const zk = new ZKLib('192.168.1.201', 4370); // IP y puerto del dispositivo

(async () => { try { // 1. Conexión al dispositivo await zk.createSocket();

// 2. Obtener registros de asistencia
const attendance = await zk.getAttendances();
console.log(attendance.data);

// 3. Cerrar conexión
await zk.disconnect();

} catch (e) { console.error('Error:', e); } })();

🛠️ Funciones disponibles

Método Descripción createSocket() Establece la conexión con el dispositivo getAttendances() Recupera todos los registros de asistencia getUsers() Obtiene la lista de usuarios registrados getInfo() Devuelve información del dispositivo disconnect() Finaliza la conexión de forma segura

✅ Compatibilidad probada

Tested en los siguientes modelos de ZKTeco:

. K14

. MB160

. iClock680

. VF380

. (y más modelos compatibles con protocolo ZKLib UDP)

⚠️ Errores comunes

Error / Excepción Causa probable Solución sugerida -Timeout: device not responding -IP/puerto incorrecto o fuera de red -Verifica IP, conexión y que el puerto sea 4370 -UDP socket closed -El dispositivo cerró la conexión -Asegúrate de no exceder solicitudes Error code 5 Comando inválido o no soportado por el modelo -Cambia de función o actualiza firmware

⏱️ Ejemplo avanzado: Obtener registros desde una fecha

const fromDate = new Date("2024-01-01T00:00:00");

const logs = await zk.getAttendances({ from: fromDate });

🛠️ API disponible Método Parámetros Descripción createSocket() — Conecta al dispositivo disconnect() — Cierra la conexión de forma segura getUsers() — Devuelve los usuarios registrados getAttendances() { from, to } (op.) Registros de asistencia (puedes filtrar)

🧪 Script de prueba

Puedes ejecutar pruebas rápidamente con:

node test

📚 Créditos y origen

Basado en: zklib-js Autor original: Merouane Zouaid Mejoras y mantenimiento: Alexander Saenz

📄 Licencia

MIT License