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

@jsweb001/zklib

v0.2.11

Published

[![Build Status](https://travis-ci.org/bulentv/js_zklib.svg?branch=master)](https://travis-ci.org/bulentv/js_zklib)

Downloads

1

Readme

Build Status

node-zklib

Attendance Machine Library for NodeJS with a connection to the network using the UDP protocol and port 4370

Install with:

npm install zklib

Usage

const ZKLib = require('zklib');

ZK = new ZKLib({
  ip: '192.168.5.11',
  port: 4370,
  inport: 5200,
  timeout: 5000,
});

// connect to access control device
ZK.connect(function(err) {
  if (err) throw err;

  // read the time info from th device
  ZK.getTime(function(err, t) {
    // disconnect from the device
    ZK.disconnect();

    if (err) throw err;

    console.log("Device clock's time is " + t.toString());
  });
});

Configuration

| Option | Required | Values | Default | | ---------------- | -------- | --------------------- | -------- | | ip | yes | string | | | port | - | number | 4370 | | inport | yes | number | | | timeout | - | number | - | | attendanceParser | - | [ 'legacy', 'v6.60' ] | 'legacy' | | connectionType | - | [ 'udp', 'tcp' ] | 'udp' |

Currently only getAttendance was tested with TCP

API

  • connect(callback) -> To Connect in machine.
  • disconnect() -> Disconnect connection with machine.
  • serialNumber(callback) -> Get serial number machine.
  • version(callback) -> Get version of machine.
  • enableDevice(callback) -> Enable the device.
  • disableDevice(callback) -> Disable the device.
  • getAttendance(callback) -> Get attendance data.
  • clearAttendanceLog(callback) -> Clear the attendance logs from device.
  • getTime(callback) -> Get time of machine.
  • setTime(value, callback) -> Set time in machine.
  • getUser(callback) -> Get all user in machine.

Handle Callback

ZK.getTime(function(err, time) {
  if (err) throw err;
  console.log("Device clock's time is " + time.toString());
});

Testing

yarn test

Release Process

To release a new version

  1. Make sure current master branch is green on CI
  2. Ensure your local copy is up-to-date, then run sh ./scripts/release-branch.sh. This will create the x.x.x branch and assign tag x.x.x to HEAD and push it all to git origin
  3. CI will automatically create a NPM release if the build is passing.

Contributors

  • Bulent Vural https://github.com/bulentv
  • Matias Ribichich https://github.com/mribichich
  • Shodiqul Muzaki https://github.com/creativefull
  • shubhamoy https://github.com/shubhamoy

How to Contribute

  • Open a pull request

Notes about versions

  • v0.1.x - Supported nodejs version: >= 0.10.48
  • v0.2.x - Supported nodejs version: >= 7.5.0

Credits

Based on php_zklib (https://github.com/dnaextrim/php_zklib)