thy:允许您的数据基于实例的数据存储

时间:2021-05-24 22:06:29
【文件属性】:
文件名称:thy:允许您的数据基于实例的数据存储
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-24 22:06:29
JavaScript y 允许您的数据基于实例的数据存储 什么 thy是一个很小的模块,用于针对对象或函数实例存储私有数据。 的每个实例thy封装了自己的一套每实例数据的,这意味着你可以,例如,创建一个thy为对象的工厂,并与访问,只有代码thy就能得到关于工厂是“私人”信息。 用法 var thy = require ( 'thy' ) ( ) ; var someObject = { } ; // Set someObject's hidden 'things' to 'stuff' thy ( someObject ) . things = 'stuff' ; // Both the key 'things' and it's value are only accessable via this instance of thy, // And only if you have access to s
【文件预览】:
thy-master
----.gitignore(18B)
----package.json(577B)
----thy.js(439B)
----README.md(692B)
----test()
--------index.js(1KB)

网友评论