{"_id":"keyvaluestorage-interface","_rev":"1-dc5f7252b3cd0995f287c424921da236","name":"keyvaluestorage-interface","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"keyvaluestorage-interface","description":"Isomorphic Key-Value Storage Interface","version":"1.0.0","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["iso","isomorphic","store","storage","localstorage","asyncstorage","sequelize","sqlite","interface"],"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/keyvaluestorage-interface","repository":{"type":"git","url":"git+https://github.com/pedrouid/keyvaluestorage-interface.git"},"bugs":{"url":"https://github.com/pedrouid/keyvaluestorage-interface/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"./node_modules/.bin/tsc -p tsconfig.cjs.json","build:umd":"webpack","build":"yarn clean && yarn build:cjs && yarn build:umd","test:pre":"rm -rf ./test/test.db","test:run":"tsdx test ./test","test":"yarn test:pre && yarn test:run","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test"},"devDependencies":{"@types/jest":"25.1.1","@types/node":"13.7.0","husky":"4.2.1","tsdx":"0.12.3","tslib":"1.10.0","typescript":"3.7.5","webpack":"4.41.6","webpack-cli":"3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"keyvaluestorage-interface@1.0.0","dist":{"shasum":"13ebdf71f5284ad54be94bd1ad9ed79adad515ff","integrity":"sha512-8t6Q3TclQ4uZynJY9IGr2+SsIGwK9JHcO6ootkHCGA0CrQCRy+VkouYNO2xicET6b9al7QKzpebNow+gkpCL8g==","tarball":"https://registry.npmjs.org/keyvaluestorage-interface/-/keyvaluestorage-interface-1.0.0.tgz","fileCount":13,"unpackedSize":113978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGaLoCRA9TVsSAnZWagAAiBsQAIKjBTWyXgLrYZHcIPRT\nDosZHb3mv5cudOs8C2l5lwAdUkKUvLT2DxgTEPqyvckVrLPy3RxfGfPGDPXE\nUh4bNTUic42tXNL4UCjMW4HdsIc2NLcRYVl90XW5ZsMUWIi5PrbLKbAcNdx6\ndtOf6nslz7vjFqCeVeE/Q+EzkI8Zfvm+F/x1iME4NUFCSwsDJaNuwa+h2P/v\nNbnCZs3IqZCLmcfOkIlaH1hP46YDm8CPe6YCt7P8pB2cKAX5KyMlhi9sYknL\nef5Vz+Q36Izvghql8Mm+3Rbsp+sTKI1Q1dF8xmxyCSoYsgC4QfDlEvZdgq23\nTbZPJmR4aP0rwHVit9kozyPoBVaJHk2TJpawALPOQ8EJhSIxm4do35pAEHoP\neUbLqMkXWvADA1ipTrzOisleZSiYz7H3qRlE8eAlHFw+t1wxgd9esxaa6kF/\nV4oBadp4Ad32ThDNMHGLkR1nqgb/naYJ1MHd9mwiPmUWCa1gQ9xWS/PLyc0w\n2+bogP/fiSuxNIcR1rw0d0OIjcHNy+NmeVMLoWrmjXYI+zAN1Dq7fEnbKFvG\n3FO3PL7wfv6mCLNN59C9q8dgXLUxoEzgKLf/B3ObYTF+fwO/NDnXv95f/p71\ntl8UGw7waQMekL662+9z9N7kKVFRYHlW+k99kh85R80xPV3PhlxsVAlR/5gr\nusJA\r\n=SmfQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC72ybzRPzT7zBtcx03tcOppvf64xB3RurCnnJ79WAE9AIhAKO8oFUf1y2CTG/ySXLj7/wkdhJyYgMcgZ8e5tVh2sTu"}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/keyvaluestorage-interface_1.0.0_1612292840190_0.8188464118663059"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-02T19:07:20.190Z","1.0.0":"2021-02-02T19:07:20.301Z","modified":"2022-05-07T06:44:21.021Z"},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"description":"Isomorphic Key-Value Storage Interface","homepage":"https://github.com/pedrouid/keyvaluestorage-interface","keywords":["iso","isomorphic","store","storage","localstorage","asyncstorage","sequelize","sqlite","interface"],"repository":{"type":"git","url":"git+https://github.com/pedrouid/keyvaluestorage-interface.git"},"author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"bugs":{"url":"https://github.com/pedrouid/keyvaluestorage-interface/issues"},"license":"MIT","readme":"# keyvaluestorage-interface [![npm version](https://badge.fury.io/js/keyvaluestorage-interface.svg)](https://badge.fury.io/js/keyvaluestorage-interface)\n\nIsomorphic Key-Value Storage Interface\n\n## Example\n\n```typescript\nimport KeyValueStorage from \"keyvaluestorage-interface\";\n\nconst options = {\n  // required for React-Native platform\n  // package from @react-native-async-storage/async-storage\n  asyncStorage: AsyncStorage\n  // required for NodeJS platform\n  // sqlite database connection (in-memory supported)\n  database: 'foobar.db'\n  // optional for NodeJS platform\n  // sqlite table name (default: 'keyvaluestorage-interface')\n  tableName: 'keyvaluestorage-interface'\n}\n\nconst storage = new KeyValueStorage(options)\n\n// setItem\nawait storage.setItem('user1', { name: 'John Doe', age: 21 })\n\n// getItem\nconst item = await storage.getItem('user1')\n\n// removeItem\nawait storage.removeItem('user1')\n```\n\n## API\n\n```typescript\nexport class IKeyValueStorage {\n  public getKeys(): Promise<string[]>;\n  public getEntries<T = any>(): Promise<[string, T][]>;\n  public getItem<T = any>(key: string): Promise<T | undefined>;\n  public setItem<T = any>(key: string, value: T): Promise<void>;\n  public removeItem(key: string): Promise<void>;\n}\n```\n","readmeFilename":"README.md"}