
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
npm install --save node-zklib
or yarn add node-zklib
const ZKLib = require('./zklib')
const test = async () => {
let zkInstance = new ZKLib('10.20.0.7', 4370, 10000, 4000);
try {
// Create socket to machine
await zkInstance.createSocket()
// Get general info like logCapacity, user counts, logs count
// It's really useful to check the status of device
console.log(await zkInstance.getInfo())
} catch (e) {
console.log(e)
if (e.code === 'EADDRINUSE') {
}
}
// Get users in machine
const users = await zkInstance.getUsers()
console.log(users)
// Get all logs in the machine
// Currently, there is no filter to take data, it just takes all !!
const logs = await zkInstance.getAttendances()
console.log(logs)
const attendances = await zkInstance.getAttendances('10.20.0.7', (percent, total)=>{
// this callbacks take params is the percent of data downloaded and total data need to download
})
// YOu can also read realtime log by getRealTimelogs function
// console.log('check users', users)
zkInstance.getRealTimeLogs((data)=>{
// do something when some checkin
console.log(data)
})
// 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.clearAttendanceLog();
// Disconnect the machine ( don't do this when you need realtime update :)))
await zkInstance.disconnect()
}
test()
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
[This repo contain the cmd of many machine ] (https://github.com/adrobinoga/zk-protocol/blob/master/protocol.md)
async executeCmd(command, data=''){
return await this.functionWrapper(
()=> this.zklibTcp.executeCmd(command, data),
()=> this.zklibUdp.executeCmd(command , data)
)
}
// unlock the door
executeCmd(CMD.CMD_UNLOCK, '')
FAQs
light weight module for connect to biometrix device
The npm package node-zklib receives a total of 1,128 weekly downloads. As such, node-zklib popularity was classified as popular.
We found that node-zklib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.