npm install dayjs –save import dayjs from ‘dayjs’ // 或者 CommonJS // var dayjs = require(‘dayjs’); dayjs().format(); 当前时间 dayjs() 时间字符串 dayjs(‘2018-06-03’) 时间戳...
首页 -
const fs = require(‘fs’); var myList=fs.readFileSync(“List.json”,”utf-8″); var myData=JSON.parse(myList) 对应json格式的读取文件示例: { “name”:”zhangsan”...
const nodemailer = require('nodemailer'); function mySend(sub,txt) { let transporter = nodemailer.createTransport({ host: 'smtp.163.com', port: 465, secure: true, // true for 465, false for other port...
在python里面pyinstaller打包可以轻松设置icon,但是到了node.js里面试用pkg就没有相关设置了。设置方法如下: const ResEdit = require('resedit'); const PELibrary = require('pe-library'); const fs = require('fs'); let data = fs.readFileSync('m...