1 Star 0 Fork 0

秦诗夫/storage

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.mjs 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
秦诗夫 提交于 2022-02-07 23:20 . init
// import connect, {close} from "./generator.mjs";
import connect, {close} from "./test/index.mjs";
const storage = connect({name: 'test'})
// console.log(storage)
// storage.admin.push({
// uid: 123,
// pwd: 456,
// invalid: true,
// level: 6,
// icon: Buffer.from('666666')
// })
// storage.r1.push({
// c2: 312,
// c3: 645
// })
// storage.r2.push({
// c1: 312,
// c3: 645,
// })
// console.log(JSON.stringify(storage.r1.indexByC1(), null, 2))
console.log(JSON.stringify(storage, null, 2))
// console.log(JSON.stringify(storage.admin.indexByUid(12), null, 2))
// console.log(JSON.stringify(storage.admin.indexByUid(), null, 2))
// storage.admin.indexByUid(12)[0].level = 1
// storage.admin.remove(storage.admin.indexByUid(312))
storage[close]()
// import fs from 'fs'
// fs.appendFileSync('./test.txt', JSON.stringify({
// a: Number.MAX_SAFE_INTEGER - 1,
// b: Number.MAX_SAFE_INTEGER,
// c: Number.MAX_SAFE_INTEGER + 1
// }))
// console.log(console.log(JSON.parse(fs.readFileSync('./test.txt', 'utf-8'))))
// let buffer = Buffer.alloc(8)
// console.log(4294967295, Number.MAX_SAFE_INTEGER)
// buffer.writeBigUInt64BE(BigInt(Number.MAX_SAFE_INTEGER))
// buffer.writeUInt32BE(4294967295)
// console.log(buffer)
// writeUInt8 0,255
// writeUInt16BE 0,65535
// writeUInt32BE 0,4294967295
// writeBigUInt64BE BigInt
// console.log(Number.MAX_SAFE_INTEGER / 1024 / 1024 / 1024 / 1024 / 1024)
// console.log(Number.MAX_SAFE_INTEGER)
// console.log(Number.MAX_SAFE_INTEGER * 5)
// console.log(BigInt(Number.MAX_SAFE_INTEGER) * BigInt(5))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/qshfu/storage.git
git@gitee.com:qshfu/storage.git
qshfu
storage
storage
master

搜索帮助