{"_id":"a-capsule","_rev":"1-679605c564d97ee3121f7d5f28c84373","name":"a-capsule","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"a-capsule","description":"A simple storage module.","version":"3.0.0","keywords":["storage","simple","encryption","file","json"],"homepage":"https://github.com/Ryzzzen/storage-pod","bugs":{"url":"https://github.com/Ryzzzen/storage-pod/issues"},"maintainers":[{"name":"ryzzzen","email":"saneros35@protonmail.com"}],"repository":{"type":"git","url":"git+https://github.com/Ryzzzen/storage-pod.git"},"licenses":[{"name":"MIT","url":"https://www.opensource.org/licenses/mit-license.php/"}],"devDependencies":{"jasmine":"^3.1.0"},"gitHead":"159971f29e3b2e9f1656fca4b779d72b75a5a697","_id":"a-capsule@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"ryzzzen","email":"saneros35@protonmail.com"},"dist":{"integrity":"sha512-rWYZ4mtw92yzWe1gbKotZAlN79llHCPJvUosTw9W1sMPPcUwimNa97u54Xz1xhrHJsl+VkrrVDCl5NoV4fwZGA==","shasum":"763b24f8c9b9badb7dc3d5fd012ce95c6b789d0e","tarball":"https://registry.npmjs.org/a-capsule/-/a-capsule-3.0.0.tgz","fileCount":9,"unpackedSize":8650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcjDeSCRA9TVsSAnZWagAAm/EP/iOckdahgmtQfzY7KVrE\nE27BQ9+Wr6dROye02OFk9MEr03Wiyo4rwgxpAIv7UY0S/qkeUIZqhFn72iaW\noTIsuGP5YZvAux6/pn5deJlf33fvsLjS+zypfr89zS8UAVa8eYRdHPkbZRzL\ng7oPnu4vesbOH/lrlz19c8wytPIqjZdR0l3OSFJ2MITBhnDmwjtnA8Cgr4mY\n4Cn1Aj9igvTI8PLJU1OHpspF4jZ4HLQEt2VJvRFiNGxNOhx3hS4yTCfIQcl1\nS4MstPARkq/ixsvSkQvgjnq06s6O1Gkbdpz/DlUldFzCuL8auzwW/zWs56r1\nKm61khwmkH2zmrnqo7hpCu63bdUmtNyJt89OONQVmU3tVX13ysOKagUgrREz\n8N23fp8F42T0ceJnpWsg3xHeM82Ywnmlm84JdQCywn/Nxi1FyG8S7bqTLybE\nJwyTYVDQKZsmKXDs1vtUFTEwKxXJQhVbnszfdluRjDn0394TzDp6AJWxrzWe\negrTjO2RCIf+DiN/6AbAYlK1CBEv7g9UY3vtZIh9dMPgTdOLxaUDlBAanmnp\nNY+iZIqpfRWgzjlyaw3TUNeLlbe7XuDeN3/IzlRbMNh41+66Cr45aXm9FctA\nK03yPNQ+3gZZo1g6J0u2Elancrjd3Sw6roku+U/HxR+yaSzm1POPX499AAzG\ndJaI\r\n=FwJA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2MmlaHBok/F/dxCUXhsdIgKCrSzjkuPcUlNZBS8b8NAIgNtOjcY0nThKICRwC3CwJDeQAMVk2JfkBeW43sC+5UTU="}]},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/a-capsule_3.0.0_1552693138205_0.6272071891211808"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-15T23:38:58.204Z","3.0.0":"2019-03-15T23:38:58.366Z","modified":"2022-04-11T12:17:32.798Z"},"maintainers":[{"name":"ryzzzen","email":"saneros35@protonmail.com"}],"description":"A simple storage module.","homepage":"https://github.com/Ryzzzen/storage-pod","keywords":["storage","simple","encryption","file","json"],"repository":{"type":"git","url":"git+https://github.com/Ryzzzen/storage-pod.git"},"bugs":{"url":"https://github.com/Ryzzzen/storage-pod/issues"},"readme":"\r\n# a-capsule\r\n\r\n#### Changelog\r\n\r\n> - 3.0.0 is out\r\n> - SAMSS (Simple And Modular Storage System) is now a-capsule!\r\n\r\na-capsule is easy to use:\r\n\r\n  - Lightweight\r\n  - Contains 3 storage types: Storage, FileStorage and EncryptedStorage.\r\n  - Based on promises and async/await, but also contains synchronous methods.\r\n\r\n### Installation\r\n\r\na-capsule requires zero dependencies.\r\n\r\nInstall a-capsule using npm.\r\n\r\n```sh\r\n$ npm i a-capsule\r\n```\r\n\r\n## How to use\r\n\r\nUsing the Base (Memory) Storage\r\n```js\r\nlet Storage = require('a-capsule').getStorage();\r\nStorage.set('hello', 'world');\r\n```\r\nUsing the File Storage\r\n```js\r\nconst { FileStorage } = require('a-capsule');\r\nlet Storage = new FileStorage('file.json');\r\n\r\nStorage.load().then(() => {\r\n  await Storage.default()\r\n  .add('hello', 'world')\r\n  .add('this', ['is', 'a', 'default', 'value'])\r\n  .end();\r\n\r\n\tawait Storage.save();\r\n}\r\n```\r\n\r\nUsing the Encrypted Storage\r\n```js\r\nconst { EncryptedStorage } = require('a-capsule');\r\nlet Storage = new EncryptedStorage('encrypted_file.random.ext', 'THIS_IS_THE_PASSWORD', 'aes256');\r\n\r\nawait Storage.load();\r\n\r\nawait Storage.default()\r\n.add('hello', 'world')\r\n.add('this', ['is', 'a', 'default', 'value'])\r\n.end();\r\n\r\nawait Storage.save();\r\n```\r\n> - Storage#default()#end() tries to save the storage.\r\n>\r\n> - If the file doesn't exist, it gives an empty object, instead of an ENOENT error.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License. You can check [here](https://www.opensource.org/licenses/mit-license.php) for more details.\r\n","readmeFilename":"README.md"}