UNPKG

zkteco-js

Version:

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.

26 lines (22 loc) 666 B
/** * * Author: coding-libs * Date: 2024-07-01 */ const fs = require('fs') const parseCurrentTime = () => { const currentTime = new Date() return { year: currentTime.getFullYear(), month: currentTime.getMonth() + 1, day: currentTime.getDate(), hour: currentTime.getHours(), second: currentTime.getSeconds() } } module.exports.log = (text) => { const currentTime = parseCurrentTime() fs.appendFile(`${currentTime.day}`.padStart(2, '0') + `${currentTime.month}`.padStart(2, '0') + `${currentTime.year}.err.log` , `\n [${currentTime.hour}:${currentTime.second}] ${text}`, () => { }); }