node-storage-polyfill:适用于Node.js环境的Web Storage API polyfill

时间:2021-04-16 20:49:27
【文件属性】:
文件名称:node-storage-polyfill:适用于Node.js环境的Web Storage API polyfill
文件大小:10KB
文件格式:ZIP
更新时间:2021-04-16 20:49:27
polyfill storage localstorage sessionstorage webstorage 节点存储polyfill 针对Node.js环境的window.localStorage和window.sessionStorage Web存储API填充。 动机 在某些情况下,您需要访问Web存储浏览器API,但在Node.js环境中不可用,例如: 在调用Web存储浏览器API的Node.js环境中本地运行测试 使用由于浏览器API在服务器端不可用而无法编译的服务器端渲染(SSR)框架 该模块提供了完全兼容的API,并在全局范围内公开了localStorage和sessionStorage ,就好像您正在使用API​​完全可用的浏览器上下文中一样。 安装 npm install node-storage-polyfill 用法 // CommonJS require ( 'node-storage-polyfill' ) ; // ES Module import 'node-sto
【文件预览】:
node-storage-polyfill-main
----.gitignore(202B)
----package.json(1KB)
----tsconfig-base.json(595B)
----.npmrc(19B)
----src()
--------local-storage.ts(796B)
--------storage.ts(1KB)
--------index.ts(1KB)
--------session-storage.ts(820B)
----LICENSE(1KB)
----ava.config.js(129B)
----tsconfig.json(165B)
----.github()
--------workflows()
----.prettierrc.json(50B)
----README.md(2KB)
----tsconfig-cjs.json(168B)
----.xo-config.json(100B)
----test()
--------index.ts(3KB)
----.editorconfig(188B)

网友评论