-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (20 loc) · 789 Bytes
/
Copy pathtest.js
File metadata and controls
28 lines (20 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const ZKLib = require('./zklib')
const test = async () => {
let zkInstance = new ZKLib('192.168.137.201', 4370, 10000, 4000, 1234, 'tcp');
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) {
}
// Disconnect the machine ( don't do this when you need realtime update :)))
// const users = await zkInstance.getUsers();
// console.log(users.data.length);
const attendences = await zkInstance.getAttendances();
console.log(attendences.data);
const users = await zkInstance.getUsers();
console.log(users.data)
}
test()