{"_id":"@aricma/browser-storage-actions","_rev":"2-a47a53470cee14720554d2c20431f8c8","name":"@aricma/browser-storage-actions","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@aricma/browser-storage-actions","version":"1.0.0","description":"A functional approach to create common actions for all your browser storages.","main":"build/index.js","types":"build/index.d.ts","scripts":{"test":"jest --watchAll=true","coverage":"jest --coverage=true","lint":"eslint src --ext .js,.ts","compile":"tsc --noEmit","build":"tsc","prepare":"yarn build"},"devDependencies":{"@aricma/eslint-config":"^1.0.2","@babel/core":"^7.13.16","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/jest":"^26.0.23","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.24.0","@typescript-eslint/parser":"^4.24.0","babel-jest":"^26.6.3","eslint":"^7.27.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-testing-library":"^4.5.0","eslint-plugin-unused-imports":"^1.1.1","jest":"^26.6.3","ts-jest":"^26.5.5","typescript":"^4.2.4"},"repository":{"type":"git","url":"git+https://github.com/aricma/browser-storage-actions.git"},"keywords":["functional","browser","storage","actions","typescript"],"author":{"name":"aricma"},"bugs":{"url":"https://github.com/aricma/browser-storage-actions/issues"},"homepage":"https://github.com/aricma/browser-storage-actions#readme","license":"MIT","gitHead":"4ddef06b90cff5208f72d13216b16ea01cfab60a","_id":"@aricma/browser-storage-actions@1.0.0","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-f3APOUtRMwenXYNpeZYQdW4u/cl/bqy16HZpa9h0fvL+RcMlRVn2h2OlGTj7VvQGIWhBXwFckKibwvHF+C0fhA==","shasum":"8a0e6c0babe5bdbed50204bbde7f8a77a0636621","tarball":"https://registry.npmjs.org/@aricma/browser-storage-actions/-/browser-storage-actions-1.0.0.tgz","fileCount":12,"unpackedSize":20326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqppgCRA9TVsSAnZWagAAfnsP/jR7YqZOZfkRNixXiUcu\nJX6LpG4VuCwWYVdSdgot8qeEeqTrtdkVu4mRo9u512HsJH5a5HzYElxDA+Lm\noyIjnrPbGZ7YdPXUTMJ5HWydr15NctXmgF02zgyI+/xMvJm62yQ+Pp/SSbX2\nz37k2H/Cst1GvPMNDwJplPGmHLlAbix7lTpzjLzkcuOlpYIvhL7aUBbhgKQN\nMfIncAK3Zok6nCVVJWZpgA/2sUSu9jJyQaKjCyX6x4TOER0mFo5g5JkcRjIQ\nCWymLfmc8ual91/CGFwarWHW9dXsLNPMsji29Ca0A5SAECxmanmx7wa2TqYy\nJmVkI55ejsKehOh210wCSFTVfJEarEstG+fQriGWqJ6jDJ5DJBui6pDmQ20e\nDejbsZdKogFesNHw41QWN9RWt/MnG+PNqWJ5xZi3kpTAEbk5gaMKijncK6sg\nMQ0lBSHKPcRFBoRNhYhlBTTDjHQ5TNdcl+H2DtUz9HgCFdR1QpKsjpeElQAS\nWBpB7FVJ3NkIhTl1V1JnZEGFdbT4OTUUCNUEh3u42gbKxYs1fhw0ZUd6Eqy3\nSmkXPZSzmD2yrx5obC8LG7qI8i4q4g3YMsaW1NkdabfGgZaJUXkjR33dQrJR\nMgK0MulvTcYbrkpgcmDIeiyMxfCNUzxc5+Z78CZu4Ta3B980PgDY/ZuI7U7q\nOfES\r\n=cUub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYEUkVfFYJtXVbEu/3U4YSq5/8GNBfGqe3ItpbgDeyyAiEA3pTDSSJeOfpWQ+uefXT4zTQQ4Ct93DSkzwa9NYobPG8="}]},"_npmUser":{"name":"aricma","email":"adrian@aricma.com"},"directories":{},"maintainers":[{"name":"aricma","email":"adrian@aricma.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-storage-actions_1.0.0_1621793375696_0.6522744376064729"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aricma/browser-storage-actions","version":"1.0.1","description":"A functional approach to create common actions for all your browser storages.","main":"build/index.js","types":"build/index.d.ts","scripts":{"test":"jest --watchAll=true","coverage":"jest --coverage=true","lint":"eslint src --ext .js,.ts","compile":"tsc --noEmit","build":"tsc","prepare":"yarn build"},"devDependencies":{"@aricma/eslint-config":"^1.0.2","@babel/core":"^7.13.16","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/jest":"^26.0.23","@types/node":"^15.0.1","@typescript-eslint/eslint-plugin":"^4.24.0","@typescript-eslint/parser":"^4.24.0","babel-jest":"^26.6.3","eslint":"^7.27.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-testing-library":"^4.5.0","eslint-plugin-unused-imports":"^1.1.1","jest":"^26.6.3","ts-jest":"^26.5.5","typescript":"^4.2.4"},"repository":{"type":"git","url":"git+https://github.com/aricma/browser-storage-actions.git"},"keywords":["functional","browser","storage","actions","typescript"],"author":{"name":"aricma"},"bugs":{"url":"https://github.com/aricma/browser-storage-actions/issues"},"homepage":"https://github.com/aricma/browser-storage-actions#readme","license":"MIT","gitHead":"c73a5f92d0f2e83cbd193af3b5af29731a20cdcb","_id":"@aricma/browser-storage-actions@1.0.1","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-ZyXsnTDk6PT3EYwTZ+K96d1ys23SAAkrkDKyzyFsqe2qmNqiociM6P0d3ELmkBlE/hyikxT+j5iUGhWoVUAMwg==","shasum":"f6817097f025928feca55b9730cc1ff5b1f63554","tarball":"https://registry.npmjs.org/@aricma/browser-storage-actions/-/browser-storage-actions-1.0.1.tgz","fileCount":12,"unpackedSize":20611,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqpwzCRA9TVsSAnZWagAA5DAP/RVaPexEMBcJGQgSNPGl\n2xIENbY1mo6acBVZx79QtKZK0AbDnTEQNQiMZaXRiyz4/l7wReBFxUgZsJRM\nQm6+qsVYLI0tCKex921CcZF8EcH8g3YzII4Mnnh7IMCxXSNY+QohwicHjj0Y\nnM9rgiudeeK9tbwsfpjMwDIir7AF6vBHdf5aIFMu7GuneSgw6w2KXDX5Ltkp\nQvrpWP2YV1xG4Et3cLASh+B2OAMTv8PCKeFhF3VSLrQxvHWwRQiweqTdH4Zm\nf9O8KIqucRI5U71Ezz9Q0wxHfrlxKqd4MN1Dg92BWRgJ9EBPbldRdCLg9nmv\n6BkVc7GXRkbuOjiFmCvEXq470GWdTAGlVL8iZ6TQaJclRMY7gLaj081RvnAk\ngx/GoePaQud+Rt4XqjvytZk6xXNNA6W7Akvr9iSCwM5rvlVS+ClDZEzbHOPr\n6YYRB55BRuVKgtmeBphvE/gReGlvDSouVMVfxeeeIwdNCkPnW+pns/D2cKaK\nnCik5Cw+08yCaqspHgh5771ky/jx/6d7GwLc1Nlz8Un09KbJQcJKBKiq7rsP\nQAmIBX9oHr6igZ5zENsu2HIPG8JHp5WvhAh4VRrdTPkj5HxNMPI+Yb3JZTok\npcvStkq5gd7sBedW7kVoU7Az1BxpfxPiwD2amzDoxy9cKayoIj6sKuThTsAG\nhIpq\r\n=eRSq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF92WyxC/yDibfydanR5CokrH8DnanxQ968Y4g3fBFhvAiBlTcxGqFK3H/8XogfpThyRyWNc7+SskR9svlV9DawjHg=="}]},"_npmUser":{"name":"aricma","email":"adrian@aricma.com"},"directories":{},"maintainers":[{"name":"aricma","email":"adrian@aricma.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/browser-storage-actions_1.0.1_1621793842925_0.910125066240864"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-23T18:09:35.650Z","1.0.0":"2021-05-23T18:09:35.839Z","modified":"2022-04-04T15:25:20.949Z","1.0.1":"2021-05-23T18:17:23.038Z"},"maintainers":[{"name":"aricma","email":"adrian@aricma.com"}],"description":"A functional approach to create common actions for all your browser storages.","homepage":"https://github.com/aricma/browser-storage-actions#readme","keywords":["functional","browser","storage","actions","typescript"],"repository":{"type":"git","url":"git+https://github.com/aricma/browser-storage-actions.git"},"author":{"name":"aricma"},"bugs":{"url":"https://github.com/aricma/browser-storage-actions/issues"},"license":"MIT","readme":"# browser storage actions\n*this is a typescript project*\n\n[![lint](https://github.com/aricma/browser-storage-actions/actions/workflows/lint.yml/badge.svg)](https://github.com/aricma/browser-storage-actions/actions/workflows/lint.yml)\n[![compile](https://github.com/aricma/browser-storage-actions/actions/workflows/compile.yml/badge.svg)](https://github.com/aricma/browser-storage-actions/actions/workflows/compile.yml)\n[![test](https://github.com/aricma/browser-storage-actions/actions/workflows/test.yml/badge.svg)](https://github.com/aricma/browser-storage-actions/actions/workflows/test.yml)\n[![coverage](https://github.com/aricma/browser-storage-actions/actions/workflows/coverage.yml/badge.svg)](https://github.com/aricma/browser-storage-actions/actions/workflows/coverage.yml)\n\nA functional approach to creating common actions for all your browser storage options.\nUsing the browser storage options is always a pain. Let's make this as easy and secure as we can.\n\n\n**We currently support:**\n- LocalStorage\n\n**We will support:**\n- Cookies\n- Session Storage\n- ... what do you need?\n\n\n## setup\n```bash\nyarn add @aricma/browser-storage-actions\n```\nor\n```bash\nnpm install @aricma/browser-storage-actions\n```\n\n\n## usage\n\n```typescript\nimport { createLocalStorageActions } from '@aricma/browser-storage-actions';\n\nconst localStorageActions = createLocalStorageActions({\n    nameSpace: \"YOU_NAME_SPACE\",\n    localStorage: window.localStorage,\n})\n\ninterface SomeFeatureState {\n    value: string,\n    counter: numbre,\n    selection: string,\n}\n\nconst item: SomeFeatureState = localStorageActions.addItem<SomeFeatureState>({\n    name: 'my-feature-state',\n    value: {\n        value: 'hello world!',\n        counter: 3,\n        selection: 'some value from selection',\n    },\n}).value;\n```\n\n\n## domain models\n\n```typescript\nexport interface BrowserStorageActions {\n    hasItem: (name: string) => boolean,\n    addItem: <Value>(item: BrowserStorageItem<Value>) => BrowserStorageItem<Value>,\n    getItemByName: <Value>(name: string) => BrowserStorageItem<Value>,\n    getAllItemsForNameSpace: () => Array<BrowserStorageItem<any>>,\n    updateItem: <Value>(item: BrowserStorageItem<Value>) => BrowserStorageItem<Value>,\n    removeItemByName: (name: string) => void,\n    removeAllItemsForNameSpace: () => void,\n}\n\nexport interface BrowserStorageItem<Value = string> {\n    name: string,\n    value: Value,\n}\n```\n\n\n## createLocalStorageActions\n\n```typescript\ninterface createLocalStorageActions {\n    (depenedncies: LocalStorageActionsDependencies): BrowserStorageActions\n}\n\ninterface LocalStorageActionsDependencies {\n    nameSpace: string,\n    localStorage: BrowserLocalStorage\n}\n```\n\n\n## Feedback\n\n- [https://github.com/aricma/browser-storage-actions/issues](https://github.com/aricma/browser-storage-actions/issues)\n","readmeFilename":"README.md"}