You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ES6 introduced globalThis, which is supported by all LTS versions of Node (support was added in v12, the oldest still available LTS version) and obviates the need for users to write their own shims. The library itself can test whether globalThis.localStorage exists, and if not, create it. As this is the true global scope, localStorage can now be called (without prefix) anywhere, just like require(), process, etc. etc.
The text was updated successfully, but these errors were encountered:
How do you propose that we allow the specification of the scratch directory that the LocalStorage class needs upon instantiation? Right now, when you shim it in, you get a chance to specify that.
Have a sensible default (e..g. node_modules/node-localstorage/scratch/) and tell people that if they need a different dir, they will need to explicitly shim?
ES6 introduced
globalThis
, which is supported by all LTS versions of Node (support was added in v12, the oldest still available LTS version) and obviates the need for users to write their own shims. The library itself can test whetherglobalThis.localStorage
exists, and if not, create it. As this is the true global scope,localStorage
can now be called (without prefix) anywhere, just likerequire()
,process
, etc. etc.The text was updated successfully, but these errors were encountered: