{"_id":"node-storage-shim","_rev":"461977","name":"node-storage-shim","description":"Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"mnahkies","email":"info@nahkies.co.nz"}],"time":{"modified":"2024-06-20T13:36:16.000Z","created":"2015-07-23T04:24:17.413Z","2.0.1":"2020-03-21T15:02:08.884Z","2.0.0":"2018-09-10T17:40:32.793Z","1.0.1":"2015-08-01T02:07:15.639Z","1.0.0":"2015-07-23T04:24:17.413Z"},"users":{},"author":{"name":"Michael Nahkies"},"repository":{"type":"git","url":"git+https://github.com/mnahkies/node-storage-shim.git"},"versions":{"2.0.1":{"name":"node-storage-shim","version":"2.0.1","description":"Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing","repository":{"type":"git","url":"git+https://github.com/mnahkies/node-storage-shim.git"},"bugs":{"url":"https://github.com/mnahkies/node-storage-shim/issues"},"main":"index.js","typings":"index.d.ts","scripts":{"test":"mocha test && ./test-typescript-declarations.sh"},"author":{"name":"Michael Nahkies"},"license":"ISC","devDependencies":{"chai":"^4.2.0","mocha":"^7.1.1"},"engines":{"node":">=6.14.4"},"gitHead":"318f4b32400d559ae53fffb5890da85890b39737","homepage":"https://github.com/mnahkies/node-storage-shim#readme","_id":"node-storage-shim@2.0.1","_nodeVersion":"12.16.1","_npmVersion":"6.13.7","dist":{"integrity":"sha512-ce8enbToMe8iUHDTMCg4rdP1K0syoJrZRO0Dl9uMLPCwlc5M1HKaapV3Pqlv6/3LQNuDiYXBm4rPlj78MeUSSA==","shasum":"6d5852f22700c2ccb48537f41a26ebea7c365b6e","tarball":"http://registry-npm.ywwl.com/node-storage-shim/download/node-storage-shim-2.0.1.tgz","fileCount":5,"unpackedSize":5756,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedixxCRA9TVsSAnZWagAA43UP/0H22zDl0uw7hfpAxp6r\nE+yFhiB2Ga/5xfejKwWxmGn1YEtnoheK3njaBXBIKT2pRaYZ4TQO2RqNxbtf\n+czaItK0VdVqO17dCrCWW0oXui6gcG3rzlsmEd6ybI5RQaCl/K6To6VjvGyp\niy1/YKkxY6LgUnIbdRIGq326nL1uxlSG/NSf6NtrgtpD9t4mmcqhjBSKUYFd\nSUEBkoAiqrz9KLILs6XHJU+XS4+k17JTkMqSwSAb1C1uIs+/2t0H9RSMmAHH\niZPJzGIasoF2lTxywFxbu9hKVojobvz2woo5bNaevAzjLz4z2Jo4cPEG1i5J\ncQnZyiCiGp+m3UWfW3pAox/LI/NzYLSV5HZ2m63R4UlPNY5JTbHo6zeHiQYE\np+X4+TOdsWXREg54Uyu5nD0xX+YqrSef1I0Oz55MgWAxkoz87f9DX8Omhc/I\n4rIe+KM9JuVSuH/RQ1rSxwLyQ8h/EHYHKzzfGynt1QWtCHiWnq3AM/0tJPXe\nTpF/BUtw+0qDHXPHuqTorBzaEJR0R79l7fBeb1lj5K/QmBw0zEOWvBPiRVLQ\nMpzwqFYywsjE4OCKfs+SYEDn2n3dXcSias0b1OIXBsoGiAONYxItAxltX4Ba\nNxr1XIge6y9Bic+8/RoPHGZVxtGda7JvuqXxcbf8HBDswhirgpk1GDDdtHaO\ngwdU\r\n=7m+p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0w+ncEduf+EG1DJx7WAoiAzeqps/U3ldpK1sWHxN+9AiAKabC+ZdGEjPLDS21WBghRK3D5LA9MnDKa9JKq0E0m1w=="}],"size":2516,"noattachment":false,"key":"/node-storage-shim/-/node-storage-shim-2.0.1.tgz"},"maintainers":[{"name":"mnahkies","email":"info@nahkies.co.nz"}],"_npmUser":{"name":"mnahkies","email":"support@nahkies.co.nz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-storage-shim_2.0.1_1584802928771_0.9784424994900716"},"_hasShrinkwrap":false,"publish_time":1584802928884,"_cnpm_publish_time":1584802928884},"2.0.0":{"name":"node-storage-shim","version":"2.0.0","description":"Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing","repository":{"type":"git","url":"git+https://github.com/mnahkies/node-storage-shim.git"},"bugs":{"url":"https://github.com/mnahkies/node-storage-shim/issues"},"main":"index.js","typings":"index.d.ts","scripts":{"test":"mocha test && ./test-typescript-declarations.sh"},"author":{"name":"Michael Nahkies"},"license":"ISC","devDependencies":{"chai":"^4.1.2","mocha":"^5.2.0"},"engines":{"node":">=6.14.4"},"gitHead":"969629dcf5de1bee54c57a73d0fb13776f5e2b3d","homepage":"https://github.com/mnahkies/node-storage-shim#readme","_id":"node-storage-shim@2.0.0","_npmVersion":"6.1.0","_nodeVersion":"9.11.2","_npmUser":{"name":"mnahkies","email":"info@nahkies.co.nz"},"dist":{"integrity":"sha512-aFwsD5axX8TU0pjtBKpuJQlofItS7Xgv2GA8woDse9tucf/sYkbaPIyASiMUt4I2kWOhzk7WzGbdZPwIGuPXHA==","shasum":"e9cc8d6fee5b14779645d36515311d79ff987ce2","tarball":"http://registry-npm.ywwl.com/node-storage-shim/download/node-storage-shim-2.0.0.tgz","fileCount":5,"unpackedSize":5195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJblqyRCRA9TVsSAnZWagAAsbEP/2LSU9kMqxcvL+eOlvv1\n5cBavulQxqyijwVFhlUcpN/SfFTaubtPFX1RVmHskBAzpuTdSz5AorCNyCrb\nzajy2vzKddkwbnbtjweyiVo7ihvx51dN8ltIc52NCW2QkbZY7jz+M6nmhnVj\nMpINJ5S0rjXm44cWHIXzFB9UUCUNnpIcTdC2x6KaBSI9n1UaV4FABI0kKFw1\nRdc6uVkKRKogPRdOIhX5AY9uzNu2hqHwi/ESZViCQgpC3y6zPu3XIqpfqfob\n5e2p6k3qJrxVBDscem24e5FyKGrqEMHmyAOSAYelhWPDZDq66jHLpGjCtov1\njOFbomHeB81lQ/6CzlktJDNbpF4RWyCKZBG6uXLC9nF+OvRuSsZAXGfQ1dZx\nqAj3OSQlf+OiHgosks0KP0NeAReOgBeIGNOWk+MoLaLTjHQsTwmLM8iCvdeK\nuh3XnvcyAKTqH4VwR/Tiaz2WPabh7rF6i1iEeDjX994V/MqsPjl5M/6MgfL1\nmRVifsL9ADfUXHdECQsprLO4xQ4T4acrlS4L+Za/HKR0vbYH3ar5WRoqXgtI\nec4SbenRj+oMuxiNVvXOMNwVKzI+0ySN+09zkeEykNOoNkb/5mFkhqgeV38/\niw7W3QBZUiZErvPnm4bXpc/5fE0ua0e9DAxLSyqOTv+pSGhpDHbfI6glW+k/\nBYYa\r\n=tyGx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6C8vYhihQLdf53ps9YCCMqhcy0z78zj6Y4H+BV6+wUAiALJ2ZcdQTMrQYF+/ky1gMyEwrc9SRtTDxAxZ5EUjWD3A=="}],"size":2303,"noattachment":false,"key":"/node-storage-shim/-/node-storage-shim-2.0.0.tgz"},"maintainers":[{"name":"mnahkies","email":"info@nahkies.co.nz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-storage-shim_2.0.0_1536601232607_0.3915725537176937"},"_hasShrinkwrap":false,"publish_time":1536601232793,"_cnpm_publish_time":1536601232793},"1.0.1":{"name":"node-storage-shim","version":"1.0.1","description":"Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing","repository":{"type":"git","url":"https://github.com/mnahkies/node-storage-shim"},"bugs":{"url":"https://github.com/mnahkies/node-storage-shim/issues"},"main":"index.js","scripts":{"test":"mocha test"},"author":{"name":"Michael Nahkies"},"license":"ISC","devDependencies":{"mocha":"^2.2.5"},"gitHead":"8a8116199e597cbe7296add184347a8e441c3fc6","homepage":"https://github.com/mnahkies/node-storage-shim","_id":"node-storage-shim@1.0.1","_shasum":"e1213219a6a38936fa8d4bcead2428ad0a3b1a6c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"mnahkies","email":"info@nahkies.co.nz"},"dist":{"shasum":"e1213219a6a38936fa8d4bcead2428ad0a3b1a6c","tarball":"http://registry-npm.ywwl.com/node-storage-shim/download/node-storage-shim-1.0.1.tgz","integrity":"sha512-fuAqzVbH7XwmuDShhyJwb3bJ8cmWwFt0TbmX8PctojvwhRHePwzPStNNuPcCH4RlUDo6K+2D0NMkuRi8rB2+kA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBiECfyYz+nvLcy41Y+M+lUlduSGijgQ2bW6Ynt55VnQAiBk/j1tygT+fICl9999NGjonMKVBbhc6h4KAiyTVL0HDQ=="}],"size":2718,"noattachment":false,"key":"/node-storage-shim/-/node-storage-shim-1.0.1.tgz"},"maintainers":[{"name":"mnahkies","email":"info@nahkies.co.nz"}],"directories":{},"publish_time":1438394835639,"_cnpm_publish_time":1438394835639},"1.0.0":{"name":"node-storage-shim","version":"1.0.0","description":"Provides an in memory implementation of the webstorage Storage interface to be used as a shim for localStorage or sessionStorage for unit testing","repository":{"type":"git","url":"https://github.com/mnahkies/node-storage-shim"},"bugs":{"url":"https://github.com/mnahkies/node-storage-shim/issues"},"main":"index.js","scripts":{"test":"mocha test"},"author":{"name":"Michael Nahkies"},"license":"ISC","devDependencies":{"mocha":"^2.2.5"},"gitHead":"25fafb0f48986df03d46b7ab649b3685e744d974","homepage":"https://github.com/mnahkies/node-storage-shim","_id":"node-storage-shim@1.0.0","_shasum":"c8f878a8e8e6b5a8910f45faeb15a1319401a58c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"mnahkies","email":"info@nahkies.co.nz"},"dist":{"shasum":"c8f878a8e8e6b5a8910f45faeb15a1319401a58c","tarball":"http://registry-npm.ywwl.com/node-storage-shim/download/node-storage-shim-1.0.0.tgz","integrity":"sha512-YPxeWMFf09A6fVh3p0qvEd306KDDbRCNm5yAxQeQoLXkYxWM8lvIlT3PgChrAfRgabBacwsC8i9+0qu5f11xGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6oK3HccqR9LB3XR+JOWV26gW2eVmJI1foe9sBHC1jKAIhAIsL9hAGTotpxxH4K2my5UIXXXpforRE28C6P9SkL2jY"}],"size":2432,"noattachment":false,"key":"/node-storage-shim/-/node-storage-shim-1.0.0.tgz"},"maintainers":[{"name":"mnahkies","email":"info@nahkies.co.nz"}],"directories":{},"publish_time":1437625457413,"_cnpm_publish_time":1437625457413}},"readme":"# node-storage-shim\n\n[![Build Status](https://travis-ci.org/mnahkies/node-storage-shim.svg)](https://travis-ci.org/mnahkies/node-storage-shim)\n[![npm](https://img.shields.io/npm/v/node-storage-shim.svg)](https://www.npmjs.com/package/node-storage-shim)\n\nnode-storage-shim provides a simple shim conforming to the w3c Storage Interface\nthat can be used as a transient replacement for localStorage or sessionStorage\nwhen running in environments that do not support these, eg: node. \n\nNote that this does not persist it's data to disk, and is primarily aimed at \nuse in unit tests.\n\n## Installation\nThe package can be installed from npm:\n\n```shell script\nnpm install --save node-storage-shim\n```\n\n\n## Example Usage\n\n```javascript\nconst StorageShim = require('node-storage-shim')\n\nstorage = new StorageShim()\n\nstorage.setItem(\"foo\", \"My Value\")\nconsole.log(storage.getItem(\"foo\")\n```\n    \n## Polyfill localStorage / sessionStorage\nIf you wish to polyfill the localStorage and sessionStorage globals that are available in \nweb browsers, you can do something like this:\n\n```javascript\nconst StorageShim = require('node-storage-shim')\n\nglobal.window = global\nglobal.localStorage = new StorageShim()\nglobal.sessionStorage = new StorageShim()\n```\n\n    \n## Running Unit Tests\nThe unit tests use mocha, and are setup to run by the standard npm test command.\nThis also runs a sanity test of the typescript declaration in the test-typescript-declarations directory\n\n    npm install\n    npm test\n\n## Limitations\n- You cannot use any of the method names as keys, this is a trade-off that is required to support for ... in iteration.\n\n- storage event portion of the interface is not implemented.\n    \n## Change Log\n\n### 2.0.1 (21-03-2020)\n- Improve readme\n\n### 2.0.0 (10-09-2018)\n- Updated minimum NodeJS version and started using Proxy to fix limitations with respect to direct property access.\n- Added typescript declaration\n\n### 1.0.1 (08/01/2015)\n- Initial release\n\n## Further Reading\n\n[w3c Storage Interface](https://w3c.github.io/webstorage/#storage-0)\n\n[MDN Storage Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Storage)\n","_attachments":{},"homepage":"https://github.com/mnahkies/node-storage-shim#readme","bugs":{"url":"https://github.com/mnahkies/node-storage-shim/issues"},"license":"ISC"}