{"_id":"@begin/data","_rev":"52-29befd248d29bf84d91aac8ccc1a51b3","name":"@begin/data","dist-tags":{"latest":"5.0.5","RC":"5.0.0-RC.2"},"versions":{"0.0.1":{"name":"@begin/data","version":"0.0.1","description":"Begin Data is a durable and fast key/value store for Begin built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"NODE_ENV=testing tape test/*test.js | tap-spec"},"license":"Apache-2.0","dependencies":{"hashids":"^1.1.4","tiny-json-http":"^7.0.0"},"devDependencies":{"@architect/workflows":"^3.4.2","eslint":"^5.6.0","run-parallel":"^1.1.9","tap-spec":"^5.0.0","tape":"^4.9.0"},"homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"keywords":["serverless","database","AWS","infrastructure","infra"],"gitHead":"0230a38c63b3e740f699a2224bc268d1825f5a10","_id":"@begin/data@0.0.1","_npmVersion":"6.3.0","_nodeVersion":"8.11.2","_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"dist":{"integrity":"sha512-pa5v2grl8HhGQPdJ2pX7Xe7siMepyAiAFqhm+0dvMpTpdf3YX16aWvNPneYEWZptPzDKgzcYq1W235CZzqeayQ==","shasum":"01227887907559d6cd555f37f89ff1d72106ad84","tarball":"https://registry.npmjs.org/@begin/data/-/data-0.0.1.tgz","fileCount":6,"unpackedSize":11973,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbna69CRA9TVsSAnZWagAAU9sP/3rYN6MZcW7DTWR8GxZ4\ncinnH40VZCK6cOC8KhopoyI1D89xjCWmBhdluE79zCB46gQHSJk6z6bNyxIQ\nNKRQpF8nfF6slYbIPZm97P5scM12Hv7lz3Lq2IMkdn7vle5Fp8gjT52BktCp\nUsjloRqzZfhyBj84H0SzlOn/cd8nMkUnnx/6dw1n4dZc6qtaI4cyoyWFoA73\n6Fp+WJ1p1l6mRxlLu+v8F4wyXg1P9ZfHehz4FLA2HTQLEU5cRYv9mHpGgUK7\n3uvOTvheQ6GTmKu8I3BwgPT/ZqLcT7WWrWT2s/I0/xBZM+ryxhkDm9vQO5kb\nZxFK8MUkUFnDfUwJzxci7FoXxijw3IYDuPd63cIjZc/busR84q6OE6I1cHaC\nOjM8O9mCY3SkNP7c6UtMwenBvNnaDM9Ksehy+xZ36X3wqn0vZdHMg2ABw9Dj\nBZmdfr/Bx+4m5xUCnn5zT8yBHyni7h7VMrwSHtlmFAWiMNS0LeqR7S081oF8\nmi1tuoXR3qoAKBMlmvnVQA77F9PFsJfZzKVFT9Cdq5RrXSX+Hh1ONJKM3kr1\nw5Gs+lDNJVC63R/0EdgJRXezi7kZOgK5prJEbXnz7nWxVPPUoPwgsp6nXrJ2\nyUzuJBpTtoOcOJkYkWe31F1knpCg8a4QvjpiLwdG+tolxAej1mFJORcHUzEn\nGrhE\r\n=d/wp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDNmiOzJNGoDhju4GciS4vP3akJ+ebQXVNpDUtyDZOgMAiBuztGbNlLo2x/3tEUBQkkoW65FCXosid9P8UnAJ/eHVw=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_0.0.1_1537060540945_0.018262688915223535"},"_hasShrinkwrap":false},"1.0.0":{"name":"@begin/data","version":"1.0.0","description":"Begin Data is a durable and fast key/value store for Begin built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"ARC_LOCAL=true NODE_ENV=testing tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"hashids":"^1.2.2","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","run-parallel":"^1.1.9","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","infrastructure","infra"],"readme":"# Begin Data\n\n[ ![Codeship Status for smallwins/begin-data](https://app.codeship.com/projects/54207a80-9b6b-0136-cc78-3a6df96c6020/status?branch=master)](https://app.codeship.com/projects/305743)\n\nBegin Data is a durable and fast key/value store built on top of DynamoDB with super simple storage/access patterns that are similar to Redis.\n\n## Concepts\n\nBegin Data organizes itself into tables. Tables contain documents which are just collections of plain `Object`s. documents stored in Begin Data always have the properties `table` and `key`. Optionally an document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params, [callback])` for retreiving data\n- `data.set(params, [callback])` for writing data \n- `data.destroy(params, [callback])` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params, [callback])` increment an attribute on an document\n- `data.decr(params, [callback])` decrement an attribute on an document\n- `data.count(params, [callback])` get the number of documents for a given table\n\nAll methods require a params object and, optionally, a Node style errback. If no errback is supplied a promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave an document in a table by key. Remember `table` is always required.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos', \n  key: 'al-pastor'\n})\n```\n\n`key` is optional. But all documents have a key. If no key is given `set` will generate a unique `key`. \n\n```javascript\nlet token = await data.set({\n  table: 'tokens', \n})\n// {table:'tokens', key:'s89sdfjskfdj'}\n```\n\nBatch save multiple documents at once by passing an array of objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead an document by key:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos', \n  key: 'baja'\n})\n```\n\nBatch read by passing an array of objects. With these building blocks you can construct secondary indexes and joins like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete an document by key.\n\n```javascript\nawait data.destroy({\n  table: 'tacos', \n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an array of objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- denormalizing\n- pagination\n- counters\n- secondary indexes\n- one to many\n- many to many\n","readmeFilename":"readme.md","gitHead":"d08b2e5c98a30f5264931ae1bc2678ca6b8e28f7","_id":"@begin/data@1.0.0","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-1Oe1rM4Dx55fYkx9ft+HwvHP2fu6Y9cy39X/kOgBr+FxE4b+dLToY20HP17ny2LLh6WBqwtygo4N/m6PEM5uKg==","shasum":"13365f8e48e25c96e4b15771be9a771dbb7d4a69","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.0.0.tgz","fileCount":23,"unpackedSize":22265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMRUgCRA9TVsSAnZWagAAyzkP/2fj3Sk/nWbp+xnxfJEF\nyACKahNk+VmAAXkVCtMjz+d8YxAiArnUyG5+4P3SkXfRHWZHG2ydoE0wv6+p\nAnskokexfnhoUR7MhCDzsNuZnAkP+L5O0vJADUZr2FgJT7sSMYZAhebA8AtV\nidAl/YcYmZeDSFZSoamB2bjSACUi8Xt3YuoCJ33qJeL0VdOykNMhfWkTBuyN\nMhduocByKQR8Bz+xK82e1+h984/ALeUKjI3+ota6Uu7T4eXu4bnzjLWXgEwJ\nD5S681h4XLJkEVwSzkpztlEDzDZ2l+4uMia4SsTIuZeKn0pBCCWN116LkviE\n/Db8+AUDIoisaoKfJAUPsQg+pCMCYXOqfnPQyrKFCd2KqFFndpvBdlCjVWyr\nCwCJHZR3ZH5TVjbNra1/Y+IyWnWqKkQHWPI4yntMU7myBLIwzYm0UPgjfFBZ\nq6dd+4qlOjgVUSpfvozTwZQMlUlOxedO6f8ffRx++7+XAHBoMIy5WvCRxNdW\nR1SWJ4vseoUxOHmOfxUqXrCWbpfbcV4VfWLzgTRuDHF4FOytXWQggDBQmS2k\n3Nla00GoQqWraXUbifr6JNVbl/7WxNx+R4NTlb0wD9Rkw5u2S82GBpkGRQgN\nRlrYhTsjGFsN8KIacJo4de02m2MhlNXFAkfzn7eRHSxGvFzHSEljiTFV10Ur\nBlpt\r\n=WmoY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMXHZGHtn26LBCV4rFxzv1ZBWCx2iygLd85yw2HXBJIQIhALVRqbYmGP7ltQsdoK5uCs0VvgRvr4eO5j0GWyNHfwha"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.0.0_1546720544056_0.17793502646870962"},"_hasShrinkwrap":false},"1.0.1":{"name":"@begin/data","version":"1.0.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"readme":"# Begin Data\n\n[ ![Codeship Status for smallwins/begin-data](https://app.codeship.com/projects/54207a80-9b6b-0136-cc78-3a6df96c6020/status?branch=master)](https://app.codeship.com/projects/305743)\n\nBegin Data is a durable and fast key/value store built on top of DynamoDB with super simple storage/access patterns that are similar to Redis.\n\n## Concepts\n\nBegin Data organizes itself into tables. Tables contain documents which are just collections of plain `Object`s. documents stored in Begin Data always have the properties `table` and `key`. Optionally an document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` and, optionally, a `ttl` for expiring documents. \n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params, [callback])` for retreiving data\n- `data.set(params, [callback])` for writing data \n- `data.destroy(params, [callback])` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params, [callback])` increment an attribute on an document\n- `data.decr(params, [callback])` decrement an attribute on an document\n- `data.count(params, [callback])` get the number of documents for a given table\n\nAll methods accept params object and, optionally, a Node style errback. If no errback is supplied a promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave an document in a table by key. Remember `table` is always required.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos', \n  key: 'al-pastor'\n})\n```\n\n`key` is optional. But all documents have a key. If no key is given `set` will generate a unique `key`. \n\n```javascript\nlet token = await data.set({\n  table: 'tokens', \n})\n// {table:'tokens', key:'s89sdfjskfdj'}\n```\n\nBatch save multiple documents at once by passing an array of objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead an document by key:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos', \n  key: 'baja'\n})\n```\n\nBatch read by passing an array of objects. With these building blocks you can construct secondary indexes and joins like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete an document by key.\n\n```javascript\nawait data.destroy({\n  table: 'tacos', \n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an array of objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- denormalizing\n- pagination\n- counters\n- secondary indexes\n- one to many\n- many to many\n","readmeFilename":"readme.md","gitHead":"5005067c9d647093f5c473dcc1706d2da8c5659c","_id":"@begin/data@1.0.1","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-udY7D6OZe9ij3Wdk7wXjh5GB0oUiJJ3SAt0pYs8mkz3GRnXYZWrsHQWx5LNX2xc9nZvhLi+nL7CAYo5Uh33BcQ==","shasum":"c25e917095f94c5e7f28e6a673a318d5fc015af8","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.0.1.tgz","fileCount":23,"unpackedSize":25028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMTqQCRA9TVsSAnZWagAAA+EP/jBPwc20XCMFuG9Kp6rO\nMdcAucw5dr89SQjp6G8vayl8/dyj3Gku74HLO3gOVh31Iymq4xESYKWwhv4p\nfJP4xgwRKo/VcJ4BZNy1aie5HABJZmaaZ3i/X23k7Lm/g0MIdn9kPQbEAjS1\n04uP7UH2XPSJHkr9/ysu8VJWAHsTPijh8boUTsfCHWhIlWAgz7Uyn2937vIJ\nkLq/xs4u3huKyaE8P9SB5WxNHh2xrjDVJ1h8msCeaehVxeJTdfD6tXZZXLN1\nTiZ6LX0ZCSJcxUOUoUKYM6PDeSV4uHmvT8CaCmhmlNeBPxxfCdn8CxMBcElc\nir6LADliatxJgOuUswtcajVfahMJm8k17UPSnn3awEeoX8nZPFWZVNPt/57S\nzmXcazxgF21OsGQm8b7n8si3yN+J2Zn5I0QSksK0i5rdK+WGbbhaXxekEZZK\ncm+DhYVko1tj8EqAOPq1lVozvJ1DrH3wKytg/BUAk2RqWNMJIHaMbRPLrWiK\n+Qy7194azxvg0ykiJd0/PvqzUNTZLkt+1Ys60mt1RswuY98OrCyccBgrzCYp\nx2rEIaqNZl0PTUvtKpcv4nwcOBSI3cegtXsPqGxThWjUoDWxC4kyJXePq8+2\nBHgCkvczYIxGRRqHjzRKu6UA45GramBO4ziEL5tMFEkGJmuuBBfzpaKDoaEQ\nfNqk\r\n=o4p1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhJdeRpY654BSPCrepeflVFeUjZad7HImqHv6THR/e2AiBicXr7JQtsk0k+ZThvBnjGBgpNrmAYR8KRPHp28XPc3Q=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.0.1_1546730128355_0.21467836667698204"},"_hasShrinkwrap":false},"1.0.2":{"name":"@begin/data","version":"1.0.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"readme":"# Begin Data\n\n[ ![Codeship Status for smallwins/begin-data](https://app.codeship.com/projects/54207a80-9b6b-0136-cc78-3a6df96c6020/status?branch=master)](https://app.codeship.com/projects/305743)\n\nBegin Data is a durable and fast key/value store built on top of DynamoDB with super simple storage/access patterns that are similar to Redis.\n\n## Concepts\n\nBegin Data organizes itself into tables. Tables contain documents which are just collections of plain `Object`s. documents stored in Begin Data always have the properties `table` and `key`. Optionally an document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` and, optionally, a `ttl` for expiring documents. \n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params, [callback])` for retreiving data\n- `data.set(params, [callback])` for writing data \n- `data.destroy(params, [callback])` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params, [callback])` increment an attribute on an document\n- `data.decr(params, [callback])` decrement an attribute on an document\n- `data.count(params, [callback])` get the number of documents for a given table\n\nAll methods accept params object and, optionally, a Node style errback. If no errback is supplied a promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave an document in a table by key. Remember `table` is always required.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos', \n  key: 'al-pastor'\n})\n```\n\n`key` is optional. But all documents have a key. If no key is given `set` will generate a unique `key`. \n\n```javascript\nlet token = await data.set({\n  table: 'tokens', \n})\n// {table:'tokens', key:'s89sdfjskfdj'}\n```\n\nBatch save multiple documents at once by passing an array of objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead an document by key:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos', \n  key: 'baja'\n})\n```\n\nBatch read by passing an array of objects. With these building blocks you can construct secondary indexes and joins like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete an document by key.\n\n```javascript\nawait data.destroy({\n  table: 'tacos', \n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an array of objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- denormalizing\n- pagination\n- counters\n- secondary indexes\n- one to many\n- many to many\n","readmeFilename":"readme.md","gitHead":"c049c821a463e12bdef0c5ec19110d7074910771","_id":"@begin/data@1.0.2","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-PewriGAzfg/vSXkJ1Jyyy04khEmtEcoMPZNOUF1ES2ZO3XzxYtWp/e94iXepuhUvOcU/tnp9X6ASURk79FtosA==","shasum":"48275724ea17d403c73ac87ab065ca27edcaffc7","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.0.2.tgz","fileCount":23,"unpackedSize":25054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMUHmCRA9TVsSAnZWagAApUUQAJ87S3AnAHgmfEFh8ehO\nEJxeTjuaiWqiqgRH8IyiRYrsecnuDep0QaJ9g2OtBCV4zb8aQGomUK3zXnLU\ndbpVRLT1PY8qfxMvp8v5KOKKkPXWMa3nsIK0CdU53Jmcp1hNvj6F4zj0PVf7\nv3V55es8oWvzhOLVfl6oKUmYYjdEAnlEPnXANCaQsvVZY/c4H1E4cJ0SxBNO\n8QVCH7/by4Hz5MXZQgH+Dt9xz8tbJqZ3ASI67N4Q+wYrY9l1im76Bn2pzAkQ\nb4HsM5z8s5k9xVIFvHtnT/bZD6S9axppE8Enb67bK+y0x6F/oyVmXWf+AFpO\n6DYJubs/fu0Zj+bGtH4nbxNF6px2c4Kh/PdDGeeUNo1UMUl6uNA3LL9nCKsb\nvI3sQvKtsus8yPLdRGbqYi/N8TKvjoGo/7L/sjaT3BSKynASIygx9QPH4Nyc\niKe/sKU32LWy8cLmVLKIsExc04LioJSI10GgW/cwXQOPMnRsrwDRj1FCGnAs\nEd96DB/Fuc/NH8JefCr3Yw4iHawp55vt1tj+tDJWgKkDVtsGbOG6kvvpvU70\nta+5UtOqiAM35Dnhs2pm6k9GIyzYBy3ZaVHsjjhxh/VU1yzaLXlxRgYo/QZ+\ne8xtbNo3M4Fsn5incaHHg2eScKecDzdEQmx28oEhZh83EzNqafvBBnRN/8cK\nZSIZ\r\n=MxQw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa19ur13ZosRjxS/9Uhehio2omXxHpp/gSRr6YRDaA4AiEAyQBDwN6SSzj9DLsPncKZ/qrZ9Ri/Vjs034FotNqISu4="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.0.2_1546732006189_0.6434585398101607"},"_hasShrinkwrap":false},"1.0.3":{"name":"@begin/data","version":"1.0.3","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"readme":"# Begin Data\n\n[ ![Codeship Status for smallwins/begin-data](https://app.codeship.com/projects/54207a80-9b6b-0136-cc78-3a6df96c6020/status?branch=master)](https://app.codeship.com/projects/305743)\n\nBegin Data is a durable and fast key/value store built on top of DynamoDB with super simple storage/access patterns that are similar to Redis.\n\n## Concepts\n\nBegin Data organizes itself into tables. Tables contain documents which are just collections of plain `Object`s. documents stored in Begin Data always have the properties `table` and `key`. Optionally an document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` and, optionally, a `ttl` for expiring documents. \n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params, [callback])` for retreiving data\n- `data.set(params, [callback])` for writing data \n- `data.destroy(params, [callback])` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params, [callback])` increment an attribute on an document\n- `data.decr(params, [callback])` decrement an attribute on an document\n- `data.count(params, [callback])` get the number of documents for a given table\n\nAll methods accept params object and, optionally, a Node style errback. If no errback is supplied a promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave an document in a table by key. Remember `table` is always required.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos', \n  key: 'al-pastor'\n})\n```\n\n`key` is optional. But all documents have a key. If no key is given `set` will generate a unique `key`. \n\n```javascript\nlet token = await data.set({\n  table: 'tokens', \n})\n// {table:'tokens', key:'s89sdfjskfdj'}\n```\n\nBatch save multiple documents at once by passing an array of objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead an document by key:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos', \n  key: 'baja'\n})\n```\n\nBatch read by passing an array of objects. With these building blocks you can construct secondary indexes and joins like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete an document by key.\n\n```javascript\nawait data.destroy({\n  table: 'tacos', \n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an array of objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- denormalizing\n- pagination\n- counters\n- secondary indexes\n- one to many\n- many to many\n","readmeFilename":"readme.md","gitHead":"79a49881592c0c8075ddad1b33bfae5ed4c65b5b","_id":"@begin/data@1.0.3","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-W2QZ0T/RYH9uwYS0ZYJq3pg1lF41O2WIfDu4EpJNf/skF6Y7OFJC4+0djRRrmkPTWGYwt1X/ZtndPEtAjMX59Q==","shasum":"0cae113998bd9581411a39adf3f104b6a3795794","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.0.3.tgz","fileCount":23,"unpackedSize":25129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMUtiCRA9TVsSAnZWagAAoQ0P/0EnHGLuzD7YH0Lkx7xB\nG6oZrrdGrtEJp/yV0hxOzyRUWjuAIyiSVtBuds/qs0JwTBAjuoS9R4fY5COW\nMW71pJJJ1RF0ranPa8Sbj/4VRlTWt/2NvHWa9Zjo8SUJKeRdJcpNE3c/2nVS\nsG/vyNzBEt9Im+JEB/M5YPrLY3PI4qww8wZqR1oRNmUL2G0/j4Xy2h+EAvVu\nYgKx75judCx5e5d4Io/4XYrtZvkyCIi0waLv5XyqrnGBlHRcm41dVGMKmhyB\nvzEq6yvZA1P7gTSF0m6RbnwD1CTryUmFBvSOlk47MUj2YQROhw6EmwwQpt0+\neJ34Y2q5JxVUnHwTCYS1x1rqFih5IZqcwpI0CNX3vSrJs3TeMO0ndMH+ABfv\nHXWSBm4Iwdqp6nVZEg4b9Qw/zcFDIc1hgTNvdJcW8IzTAnWnqk+B3kIxxBpx\npFPwV9mUFbUGmZZWbbG0z9Pgf9pNkeJN9ms3yj8rddt9MMnZxvCEU20SezXF\nbWkzhaRvu1AKPe0muEqErLoNBK99Yfm/E77tCmDP/EKfZEXDvEAND54EUkNh\nkLHOTkSNTuwNu/nXzwz6JyvpTujlD4PAhzIgxSbdjmff7FFI86yfZOjEVIxc\nT3XzHK/hB0X7ov4dS7MsOclEbLKs/fMS7z3RT7VzbSU4caqGYDTSZZTukj3a\nsU/i\r\n=1zto\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1wBk0IJkNkc2QY/XcxfLXQo+NKbD5FynXtDU1fV6ibAiAjERZngsbJH4dDSw3smb542lBHrvr228hG+VDxGCpddA=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.0.3_1546734433856_0.8216673439732942"},"_hasShrinkwrap":false},"1.1.0":{"name":"@begin/data","version":"1.1.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"475172999fdb122247673ebfe879c31138fba740","_id":"@begin/data@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-ZZoHTb7+UslalD5QtHjFZ2ykM7zVvcDL7GJjd/oypyXlZapKvB1zawXOHIKcQUnn2PPk4A1j7afq+e6Vl+ZJ0Q==","shasum":"ae02ada277ad5e2ab681323b15a814d6129b2567","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.0.tgz","fileCount":23,"unpackedSize":25129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcMnx9CRA9TVsSAnZWagAAnnEP/2L3bo3B0Cxmoq2eYBi+\nhVY05WzlEwAcAX5btZsJI2H4G1w8i5p6IJpMUbiOTFsGmfYB9ZAqPx1G3JuJ\nk8L2A0Cas5NbrA4s1erlyen3O820vr734L4jlSDy4aQxDGLlTGrmC4zu9S3x\nRg0wMkCbjAzhWZlgEdVGyQmfL3BcPrkxIMRZme4WjGCuQapwPJ3xMPgIRMjp\nIvBESnMUoAuDcRADzi/T5Gb0/dgIpvJ9ZI+gzlV8hUybMJFjPqVYqnleZJLO\nU1ulsa1UdDyh43ZZUHh60J4L4N9w5OBsTTVEpe4GrmT3hvJicikKJkdUWoIZ\nkrtRTCvfbMYDVE3jkjxiSVV8YxDUjEIoNDORm0hkr2vvjkG6JALoxoYMjXsI\njZMhD+CUruiySZ5DLdUgQq0b5GqWr6rUVCamTN1Thg8USqiNeijsv4KEtaHX\n1WvSGFd4XqC5Pqbw5OuXaUqvMSoAPfgq7wuTXjb3Ro+EhpC6BmCPBMHI/sJ1\nhsW6batOzb9BYqoLIwQ6928FtHSOlzdZV6I7oRxugbeTtAHdVgRT+rP7HBtd\njM12QyurXr4cHEg8DsCQQ+Nr8ZxjAz3hFAhNuHoMvItxSDxR1UoK8AlBaM+s\noOnrzauAyiof3UDvT1ymFN8RuAFBwpsdJ70JpdmLjAUrgAkrPr3zPpMYvwgE\nNHHL\r\n=OoDQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIjortsrRTJTt/ygrZUEpMYki78eQEAOai6wGEbrqu5AIhAMuTdLhfI3Nn0jpPXutFRqfK0o+7aiKwYcgG737Eo4K9"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.0_1546812541063_0.8225856762957899"},"_hasShrinkwrap":false},"1.1.1":{"name":"@begin/data","version":"1.1.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"563447196579e561cf65c74ae1762644d767d15b","_id":"@begin/data@1.1.1","_npmVersion":"6.5.0","_nodeVersion":"10.13.0","_npmUser":{"name":"brianleroux","email":"b@brian.io"},"dist":{"integrity":"sha512-8ZEvohRxMKYI1DsdlaURWzDbjf+nzZAJmBvyGt5Qlp88g6EPxX6kvId8+gd8xsd9pPGGvkqpA47y3yWfptsBfw==","shasum":"c23e2152b3df64b7a257f63d36b1d9ca0efdd1ef","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.1.tgz","fileCount":23,"unpackedSize":26093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPVoiCRA9TVsSAnZWagAApHoP/3MgShiJvdPFTw6JX2w1\n18+yqV31iGOKiFHUAJIXFAHOxWPsHZYvWieqYN+bOME20CppEEEIAJf0G9xQ\ns/z9JJ/9F1dhn9GhH8p3pEN19BobAncuHLMhJu8SZ4OOLcJmHOhSiTPP9n5i\nZuy0gSZEI7lR8WY2TtXxeFsLVF1dvEaz8G20qpny0XTOsjBtpJEkNC5yMmM4\nj7eJ16pG58q0r6tF92HYZOIisLaA9ENtdY1mqmV9I+RrizrFUzF9GtXKxVp/\nAMrM6MRgolQTcjJP5qZF7tKVpoz4cQQjo8zeGu8PCFqu+f/OBwSYo8mBdHN5\n9Qs78Vxj882AP4pIXfrR6JaBb62rQ47G6nFJEFn7ZlV0y1gdKLWgEG+uqwmA\nerYkhUMInuTSHuSCYFqEuwCfhYPbLpr3iprdv9qBP8RMzbu42xqtOEtGgyKg\nrqD5I58d1RTrKM0T4NioeZb5ODWx+4GUVliBeuH+NVIjyzDPKz3oJTvilEv9\n5AZCcjtZd9cdwTyhtWtR9ghCgQ4wG9dPvriMJeKuVSLr9rGo/iO2EDRCDXfj\nahvuShrYB41YMBUM2J18u6VfiojKeAM65XJVl+YYlv0cTW4J4EL5EVBRXGVH\n9cpo+szTNkPZ/moO/kLCUoe7pNGGVtajdb75jiHVgY4W+JXtt7pvunQ1WE0P\n4XA5\r\n=uRBH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAekvxLqooU/vwLx3EwDJjw412YPQgdZ5aIRABIsb4MBAiEAsoQTyO+3qOl3i9FolpR93UTx2e75Cie4jlDUwddWHFo="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.1_1547524642215_0.05742187715891656"},"_hasShrinkwrap":false},"1.1.2":{"name":"@begin/data","version":"1.1.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.1.6","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/architect":"^4.4.10","eslint":"^5.10.0","tap-spec":"^5.0.0","tape":"^4.9.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"60992176a46ce20a27f82a007312f6e9ce58061b","_id":"@begin/data@1.1.2","_nodeVersion":"10.15.3","_npmVersion":"6.11.2","dist":{"integrity":"sha512-8Lt6Fdpj4n9muZn3OkHSAvfE1SaHT5jXlR1X9miKulYeW5P0DrQHQ/2L/WmP77vRO+Y6LiZ2oUeeHIE3XGCCUQ==","shasum":"a03a5a2f3115a529401d5a0e936e09412e7efece","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.2.tgz","fileCount":23,"unpackedSize":26450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbDC2CRA9TVsSAnZWagAAbC4P/3LMDHTmBbWaUbfy1lE8\nb4hxdKINctVxAl6Sc/8JOewg6YzcaXpd+8DJWwtBQ8uigZ56BO9pf1LUjpM/\nlQ1Ll5y9jd2F1QvEVpEcWui3++gLcBppKSqSV2uMiGTvBgkpgQ5adGzWJDz2\nMV3p/aYpn7pVKflolBri5KXB+m7JcJ1Oy0w+jn55/ouX1pS8fSnX4lLK2zyO\ns2fYYf7K7f+O8OqDLl4UK9Sfqym9Mp3NADc0qIa6+6qFUFd5ruyX2dmKpwBY\n3SSYT6bXSM9q24F4GP8HBN4VW1KNftbglw2t8czv4jzSeAiPE+ySwMKW3MJ4\nL9IFXYRtUFxQmOUTsyHlQZvgPBcYDANgWOlqRKLYGvJ8eF5um8oJM+aYs4dj\nhxHFVwVpUm02H2xbYw3MKqtPdsRZ3XneWm8vcNCclYiIqtS38iVZelmqrtYR\nl5WdhVowynLoalJaqTjaF3kPoM/cr3+6vFpa+hf+It57o+3qiCISMUaqw8Ip\nE+SxGUXAhFCvXVHs4Il12KgRJZL/m8RibikFfwYZYwdXoP3p9mJ2Mgc8R7lI\nGqlEhRWdZYSqDZhWM+1AI5w0wkcLH4uH5Rn/ZP3rrJa5FHZIGtyTznBBlKPM\niz/yhH+2BIgC7QO5Hj0d3g2Wv0u+7g/Xr7OE923p4ziU+n8eGDYUVmBvD0bV\nsIG1\r\n=xhT+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKYWhoeM+tQVy95nlMC7M9MQHcSWkpjdsv7pX2/oU7sAiASD91Dwu3BWsrLBqq1QbBNbcSM4By3/uXHNp6zAhIiDQ=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.2_1567371445758_0.9130945498448129"},"_hasShrinkwrap":false},"1.1.4-RC.0":{"name":"@begin/data","version":"1.1.4-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.2.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.3.11","eslint":"^5.16.0","tap-spec":"^5.0.0","tape":"^4.11.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[ ![Codeship Status for smallwins/begin-data](https://app.codeship.com/projects/54207a80-9b6b-0136-cc78-3a6df96c6020/status?branch=master)](https://app.codeship.com/projects/305743)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema: \n              - \n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              - \n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification: \n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n \n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data \n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos', \n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`. \n\n```javascript\nlet token = await data.set({\n  table: 'tokens', \n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos', \n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos', \n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","gitHead":"364a0af2f6e73640409a5746b33256e929cd9135","_id":"@begin/data@1.1.4-RC.0","_nodeVersion":"10.15.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-P39GXgHK8k0+736oaEnLt4ZMfqEqHGcbOi8ZXgiYz+lX8leVNBWx2ltgZfV+w0278tsVkpsXkMO/fOuwXFhqzQ==","shasum":"9601f40e65a26c13d83287b9229e607a62415602","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.4-RC.0.tgz","fileCount":28,"unpackedSize":32804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdet65CRA9TVsSAnZWagAArb4P/iQgQJ0U+mGaZgcGnc/L\nhP8TI+2TIig1iGOj2rUtP/bESViKoyBkgN0DptwD+YyFzPH7eIiFKz3on2Mc\nGgaWGMOOmqKCyqwAebm5+VOsK7gonYPLxLnbGqEANRMFOLcTx6AQxvRjZnjJ\nULBsw0U1C/SvlUcbGlQngDQlv1McCePM+g2h2rClat7AYmv/HFBDK/rAlHWG\nQhqZFbPrmybOnuofNpz11EG3M36ACZhz6Jv1G0eVIGPcPD1u1t64ileOjjmE\nAaUk7tI2S9nVpjvAdShmhjGypIY2ViN9FRbiGFjPGjFd7/2UXrydGTfXDRmM\n60ZXMgk0Kaogl4RilQFdKyp8iDgwlTZleKEfR1lro4K/St8f9Z+GBmD9OZLT\nofVa8pGxulNfE01lLToCtwPF5OyLsXzuueHfjBaX2teUpG67Y1Jpioi7aj5v\nZ1SreP+cdNlHXiVPQJXmq/yrIA9UXkcyBSjozuv0m9XBEKSD8pZ0luo9TiAf\nYBc6VdJ80fLA1yV6IirDZHo7WS1SWztXwpMyAc1JMU3XpDAF4q/nm/j0qpPh\nPbEwiNrId7i2FYe3hh3Dw7ZGRHKpbSRo8ZEULmE7gC6cT68PknUmVaM8X91w\nFcUdetUtaLwNiNk55Mm1Wzmzu2pxZrB61lPLCq9MGBDULBIjqbf4r3IqrHtL\n01Id\r\n=3ExH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJAjy0he1GJcts/1t1gpLzSrJxN11TfJKpc94/cB47WAiEAqds/kLNRB6jLlpIuZaIF0ubOBOnrDqEDRNV6DoUxt0E="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"brianleroux","email":"b@brian.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.4-RC.0_1568333496417_0.3899556963455799"},"_hasShrinkwrap":false},"1.1.4":{"name":"@begin/data","version":"1.1.4","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.2.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.3.11","eslint":"^5.16.0","tap-spec":"^5.0.0","tape":"^4.11.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"3bbf46dc00f60d605653288308ce57717bd121d0","_id":"@begin/data@1.1.4","_nodeVersion":"10.15.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-srUt6HFxancYgdZiolm7YIl3Hw7DqxxKHScFAb+eKQib5DxH70kXp2qtR/kPVtC4uZHWvPu7auCtIphzqqqUsg==","shasum":"78311a5d96c4dcff1a38ec9842b9802d8b8dcb27","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.4.tgz","fileCount":28,"unpackedSize":32799,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdfB6ICRA9TVsSAnZWagAAoLUQAJny0xOTAVmLukCxQheG\nBlwawWa225Jl0zLX/ISE9oXbQrwRAmKzmG58917A6aYwsQuHY+jBBxA05YVy\nJKEe6kdn50UZzSnGpy7EwsSpcUQqgwLQFp7zpBUepygGPY6mvwQua6N3cBcl\nPahRbnfXv9PkVshJV2sTUYLHUY0y6WG4FbdeLPLx07o1SwtCkSov6OOFONUF\nCrtlT97RDOHAwjvPzdEmRv5x5ZAKi+6xdtShyw9kGAj7V71KJwIkdwxJ2EVG\n/YV+J012KzFf9zahuOZcYVAWVTI8ohpxBlfJr4kIaKw4klMF1BGKgttWNu7P\nc2lHjCcZCGRUGc+5n8O7701ihH2WcsZKqt/pXkRNZKoZOL7w+PI8h/czzsAi\nua6R1IBcv++l84FB/hdhHiZwmo7FATm5/AvjSFmz56he8oI/C3VfGkUKEImj\nwinh1tR78R5yO00FWPSA1LdDOl3irpMCBvLu3W7M7LjThuR2yMdVrfCt3HM3\nFf3ZQcGAKhebBxbZoSWjafHBwC8D/nCIHfxGcYxfgXTAzaWaH8Ys5erqMZls\noz7v9fCDDHwcfrLG7WAvtoJwSPfGzrGdT43IaQYcF0gi8bBOmylnUkqyc8fJ\nYQhAXjZx1tdAfVdAxuy3gylkYrF4eQhfGfixPKbob0cr0R+wJu2W6vINw3Hb\nYysE\r\n=AWGE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAk9MGNkDZ5lk6Kik09SqY4fsZ8SWMOd8uDgXVN2XLvLAiEAmZNH1hG2uJPyIy+XzXtr05SZDVKEiLwut6NaquxFgoQ="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"brianleroux","email":"b@brian.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.4_1568415366952_0.981247550436879"},"_hasShrinkwrap":false},"1.1.5-RC.0":{"name":"@begin/data","version":"1.1.5-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB.","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^1.2.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.3.11","eslint":"^5.16.0","tap-spec":"^5.0.0","tape":"^4.11.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"27490cb4128bec3cb9beb5e4a5c6efb38194057a","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.1.5-RC.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-B/zxWRb9qdjLr6eLDDk6WGVMYeGtYef9eV0rO8tr4ge2jy0ASuPaA4/ERLaZAnc9o4m5kWsgfkbZ2PiQAUU+7g==","shasum":"2990e639d7efe82ee50f5443ab6501a45569a7df","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.5-RC.0.tgz","fileCount":29,"unpackedSize":35123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyjxSCRA9TVsSAnZWagAAn/MP/R3SGBl4W59N6XJeod3T\n94Vdy6uvE0FCqBI96Odf2YyrWmoMR3BSL+1cLsawSapTvLpmYvwkvbDVAgGJ\nCt4WjQzA3iLqxyrWXez6ZcFddLxo1PtGTiXRua7CaIOHMFoiOFCHw/5SzAfK\nIEIcNiOa27vjDiyNmOnKv7EL5FptnbHcc+WdrfhRP/TzO187RslCFXTWIBgH\nkYwixMCDw6Usiq0I8oMhvHpeZVQA/K2t0s8k2weTWoQl33oGr5EVi/YjutYi\nd+nbFd4cs1p1jbtO+ZXDYp5lb0GFQnysBUaEPUR9Wv2fhK2w7fsAi9cYeKF8\nbU8SN2gcs+WvA+GEEbECspVVXEQe3apI94cDMKQJ1xWcx/lk1cxBSgcvm5LM\nuOXpmHzDaFPWy+BzAwu8RQYhDO9F/OvjAi6sQiJouu1eHYQthST3EKX9Ll7K\nZMVgHdHmrX4vIZgNMYiYPewdzpryE4Up3docJB3GeWuvHUIlQXI2dVRsqd8g\nTz77Ari7vsfO+jE0VJX0EJgIUKfGKcoYOhsYyYiHVw4nNPBhXEBZ5aSesYmI\nh3VKrHEjf71zFIgKsOFck7e9dZ2N/DhO4ncWkNeObAtsKAUiQue+0ESG3Gvz\nrFy2y37z4CIseYFF57RN+yZ4EyGtPDH1olbl3gXgR2axTu7HI/JYJyZHVTaj\n2nvg\r\n=Hznu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtADVHGPTnV90VinFsrtBpbYGbzcH4lYP0aTvkEm7A6wIhAKuXaIck3/63bX6xNzk0K2gNbf8uZzSsG/0KcmWKb1sJ"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.5-RC.0_1573534802149_0.8619730465974635"},"_hasShrinkwrap":false},"1.1.5":{"name":"@begin/data","version":"1.1.5","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.3.11","eslint":"^5.16.0","tap-spec":"^5.0.0","tape":"^4.11.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"76897aad47dfec4a2356abac00b66c6fe0f946bc","_id":"@begin/data@1.1.5","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-XAG2WwV51FSK/WPBeHoPyFnwZirPW+FmyGU+ZJUPnEyN/p7v9IwcWGWMSd/DgnZKadiSC83hQ91GccBZ/tSUOw==","shasum":"46e3f5c47450b710db74b43a420a85e122cc67a1","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.5.tgz","fileCount":28,"unpackedSize":33186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeN0teCRA9TVsSAnZWagAAWRwQAIyUw5eKKfVEeooKY3F2\n9jxKknW4oRrPMHzE70dNqMwzzKuc79ocMeYI5/AZeYNLZD41eTHqM9y179re\nkzIZdfta+R/oo3UUHZjpvP0GO0+pbhx8yYK2IL5ADYfdi46MLu5LODmbXt5n\n2qqdM8rZjd+39cV716BAtjttFClFxpDQysFyNJziqoH4bJ41tlcpK9ANR4mN\nTm1xRgVW5GOPMoGlZUuKnZ5qNae0C4eOsC7WM1DAc350M80QUAf9ttcJjCOK\n1wyqKPrQa025YPvaKgn64j6tpyHFcS/ZBvsGIzs1ULRsd+sZLl2SbImBdcB2\n35PZaeshn57tjV5vPcEFwlxD3c1LRyCSyLt0Dg3kVQMD9O1rlEUP9edy4O2x\nLQ8CVReqYQ+1b5T1t5EaqpzsUyPRXyAdRQZpwZhGTfiGgWm+Jpu6jNacghUK\nnv2g1+O1Mk8NOVz60IAE2fNDTq0gG+tmwDMmvv+zvFzCFIEbig1ulLl8qBEX\nesfTqzFhgyTScd5LWbrMZk/catzCsBS+6vFlDFBL5klkFdw3L5aNu8XOfhaw\nVNodL9zXsri38JZqkAI8Li/C48ydN293nPy1MKQX/wrgya53feFl0+rg1y4P\nW9DCq4N+Q8jjDP8lOEnO74EXPnivs5oE7yEYkidgwHsM7LzRi9VLmii/9LS9\nNves\r\n=T+7H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+go0TGfA9S5AnceRbX6fi11O7cKibogS8yCp4XkS3PAiEAo7e4R4o4ZpbcUMUehHI8bIzFjzO36TY2nQN42+diMBQ="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.5_1580682078367_0.5175233868767763"},"_hasShrinkwrap":false},"1.1.6":{"name":"@begin/data","version":"1.1.6","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.5.8","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"39e61c927b53a7b3777c32f0f8e532d33f6d1c89","_id":"@begin/data@1.1.6","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-r2cnziVrSDvLV1c1TZZ4zoa5vma++zTH0NBsBXmRqEMgaUfWigJ4YJZu3Xrow9UT6gFePVYrBIBS+7el11G3Vg==","shasum":"38f57182d67d7779b9c4624c28bb6888dfaf8f3b","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.6.tgz","fileCount":28,"unpackedSize":33747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzSRCRA9TVsSAnZWagAA8bUQAI3VKQUmITFxNpOxayir\nm/0L/Tg4qrYB9c4rVLDAt76EMlDMh3JJIXIkGyfOrlmn1h/OlRekjYK+Qt9g\nUKFa1uzrFfqlS+aBw4PBF0If1wmq6SMoHlv8KcX3fZnS+X23oYqLDdh6nc8U\nmhxygYBUOZGZCq8fG1GL2Hy/rv4yiF92ND0YGftIPlJOMRY4PrtOp0T2Z22g\nn1xnxFJXrtxqaAa74026O6UvlzJEf1ZjJbpjxU5dbrGnN7DqV+kKqtMSTzeX\nU/2SI40LapY2gNh26PhyH+oz+6xZXoEmTS+4Z0CGVSHuqiaRYBI35VZK3bOs\nJvEh+X59JHe41DUTe5pwp4qXznOfNSm0YVYkTQ0zCf5CBqo8I5KRRei96M+h\n9ft4jqG1tD0FG9FWBYBkuPew8r4K7EfQMss4AajhoHUgxL8OZvYwWYoHvSFD\nZw/rvde4SZRxHEZ2UfUlk0qmdJaunXru9k2sWcpyWXUBD1gSRT0px8SjSsRN\nh311e60CLAmwd3kZqNDPjhzSyCPmYDAHwXNEJEwAPnVYt63bK8zjL84RpZBg\n30n0gkL378i+nEPb+1JsO4KxxuNuM6jS0Undpo3qkGdhX6vok9Eu01BhwiaL\nq6jHBm/Wm4zH77JlByqN2lLkDItZ2z9NItkDCbZHLw2tdRMBPoq6ttwL68VZ\nuoKp\r\n=qPa7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGdgR5fkt7H0TOlfm1IIFvGdFrR1E+wuIczKJe4y9w/sAiEA5OitY9rbYEfJzsExmX2OIK/+/juKcEbolwUItJNzrG0="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.6_1580938384519_0.10283254643726814"},"_hasShrinkwrap":false},"1.1.7-RC.0":{"name":"@begin/data","version":"1.1.7-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.6.1","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"92c04b407f87084397b502eebc1120edc1297e10","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.1.7-RC.0","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-AoXUAU9kjBw2nsV4ocQiqiAWcS2uzaMLlT2GElM8EXSkzDi29y5NDV/WvbrDGQ0o/l771RS37vKb7UWo0/cheQ==","shasum":"d504a5f9b85537150f7291c0eda90df5580a8bb4","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.7-RC.0.tgz","fileCount":28,"unpackedSize":33358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO4A5CRA9TVsSAnZWagAATXkQAJhktY63NwuP13NCTFgU\nB1IXW/pvuMrBfIDxBU3HedpHQKLx129ohSsV7Bd2HrOtmorn4vN7mLG8cby8\nPPiF1K/FAFNuzXoI2WEoaVBixoSPr36Yx69H6nXyiWjPy7SzlHNsIeRMQAMv\naP8AoEHbufb0R11BXK6+OHG1Ij/S3Uua4aDjA2R1WqBOmQZdiTke16HuWyBI\nQjJGWbTSO4uEzPUQAyO/NnZtG5t340XHDr7ECNTXwBfDKISO+HtnwQhf/+Ds\n1NIueCWlcQc2s1VG9e3xG24S+TKu/tvaf3m8sA5h55Du1KGKjinyTN8crNhX\nRaAtD78LayyP1uhvT2xTz4xPwHz3/YabaRl7ZtYslsweHrsXkRYg96DqpFw9\n9hN9lGIq/BwFBnLduQVyrbB5ixpTtkHznzItNSkJhhiKVmlhQ/kzdb/vQT9f\n2l2tyzYW/S2UZfiof7wyK4QvAk5U5OyfCM5iTfxkTLgP0ivqdJFxybnMNcws\nrMpE0bylut3lhKEuZxPjzXWvNb5MbK3Rxqm7/v5Y6EzJSWKBG97xXneCvE8G\n2UZ0gmbyCWw3eZ0xu0paxPyZ+qIJ/zvG9e87ZbSXZ7buTXPuErHJMECfjPHD\nGcKAooRyeuyQ5ndCWYAs+07MgstnOMyu0m7aMaPxzaY9rmWZhmshdX28LTRC\n3/7I\r\n=9M7A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUABs5MYijcTfKqj9rsYN0Q4Tm7E86Q7CNFBkzvBXFPAIhAOVFCaTnoCryZAJJWfKwmKfs7+bMJr8DnZ+HlB66etGT"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.7-RC.0_1580957753180_0.8903705944918892"},"_hasShrinkwrap":false},"1.1.7":{"name":"@begin/data","version":"1.1.7","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","hashids":"^1.2.2","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.6.1","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"7c268b1e477ee5c5d8fb3faa6109b34a79d1d1d4","_id":"@begin/data@1.1.7","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-0AO2DvSzfITE55kJhU2/acG53Cw4vKdzom13cPqasK2h1Od8rqIARlY2dN+GgeGxQl00/XWm0voGxbHYCI6xnQ==","shasum":"7bc9252e396c55ea887dd22ca44694dffdffc9e1","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.7.tgz","fileCount":28,"unpackedSize":33353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO4EdCRA9TVsSAnZWagAATRIP/RYX6T2Qc2TTgnRyECk2\n7uOx8bpzgksdQkP6wFKANXYjXAP6k6M8SepHixqnJaKcQN8YPqcf4UVgncb4\nPiPDlhQydoAM41auBYXlBxhSjqD35OZR/a8IKZ1NammhIz2C2gCGp9Pngt2V\nQBHWy9cojxA1g6qfNiSdmDlohoFCR9b9ZCt6HEdIrh6eN9Rql0zmQ+Ye0NxH\nfWP0BHgSLuklqlDsjIllEe286TZOgihToTXGfsvOwmrFJ+lbzrApHJ5yuRWX\nyQ9v5BOBKIRTDep8jf9cxZqlgnrjtLjRjv61hrhPazuzSBGWF01+STi7u/qK\nFZ2G66AA7HnsEU2gb8GVAxBBO1VOgzvAmfCzmbAMINXS10r/Y4kLWZsGNyOJ\nbNgsqKPGvFXBFf/eCrk2bpXWfsXLeUJV96yS32XF05D8TlcW1gVDiAWbXErn\nBH0f0BdL4AzCokDqDnMTLChiciRXXNSJv7usNfCRSiUs1fvUN3eoiWtw7OdN\nF/tq1OMbBpVNeaMPuunPCJYXfGWoOc9BwwH6SJbwxj/4YB7rjnbHAZtJ5N0O\nLOwfPJ4r6fnDgxir+WBvqVvuRowHUDoshB8F1dLkynhY0SyWF11XoW3CXzbC\nHDG7FmgIvfW/wzHJGB6d5owL05J0ALh1c2w+WdfoEOTil5008Hqc2ljr1yWj\n2XWs\r\n=A/sa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXZN8VXeO27u7GoYBJ0chkIET9JJyfPpuTgem0L+rPjAiADiS1KbMlJyOCyr69z1Yz+HLfxroa65nuAxt8VApWrUw=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.7_1580957980873_0.4320678040468926"},"_hasShrinkwrap":false},"1.1.8-RC.1":{"name":"@begin/data","version":"1.1.8-RC.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.6.1","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"00c18ed63deb5304231fc8591c17f265b03753f6","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.1.8-RC.1","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-YR3BwscFBQLwqHTftlvW0Gr+6/9RrgWVB5JmBOiA8Hw5YCiZI85rslEuerOah5HPcd8r0l0DfonEf4LJ3fFdNg==","shasum":"201f8b4680ad6bbba2f60799eb5ead39d4c47a69","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.8-RC.1.tgz","fileCount":30,"unpackedSize":34187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQIGHCRA9TVsSAnZWagAA+y0P/3+8852YZ4dDKN4+/QIs\nJKHIQ1pBPD+4/S+OQv72kz59nEces0opFJsnZFCnanO/pagscn/zk45h7f6t\nAoCxHT/GLDYQxKz770w2IuRFZr1iNi6u4g+8W7jqJY2bf8/LhNUngGgG+NXp\nEswVJnWCONES3VxXR3sVcKc2wYnMlsx0ecLILgDBKOiCu/9CswJC8/4vzXVH\nARzZ/yF7o0UJ2kuA7Boa/BIJjM6qZVc9ticbvXDfcENe7W/8oG6rU8fUmDkk\nz7ADMRJCjukDMAUi4wq8be8FWbRxqhrCgv+EcosjiXxX04Kv8KcFtZUUheoR\niMgbna9CJGGGBE+ham+tPpwmtodfqCElI6e3nIRC7XVFL6kE1EEbf1HsqZjl\nqffmpIDVvqu70hmXoXNHZaT156q6n98O3cA+iyWvGwaahai/n2J7g+VvtKLf\nI9eSjnDX4OyJ9iR7NZo6aLlCDJg42Bt0aGJLIxZR+sw6vPpU1JR/SC2jPTic\nczSxkbPLlmImEuMYkf+pkNx3cX29ey8SgkvR9RGQ2NdzBtZsp5q4Nd8NCheK\n9BlfRPhgffeUhpGo1hL9m0wom4XAIhJ4PkTnMZADmaLcZ63UKpWuKErVOkj+\n8f5MsJYfHsemIVZWXGQa4ekv3q1O87q9G/0GnRphqrJC2KBBHJjmrqBvLsP8\nGsz6\r\n=yyZg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEc1jwiywwZdoihPLzqOWhikBt2H54xoby8OHv0afbVAiAoS5A4+h1buB8ncRet/ZCM0+rr8G3nbdpUgZrxmH5k4A=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.8-RC.1_1581285767258_0.716616681972251"},"_hasShrinkwrap":false},"1.1.8-RC.2":{"name":"@begin/data","version":"1.1.8-RC.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.6.1","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"5af9d401259ee63b6aefea48d03b6ed1ef578d21","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.1.8-RC.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-gGdi8iJ8dgOnHLK6qPIsLABJ0LnTiuZwPE/Vs18r8sFRgNanyfZ5FQio9exhx3WPjdLegxwKmTdZVBJzXTms4Q==","shasum":"caa62fa6fc2115574ce62eb554c0f05e52e10593","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.8-RC.2.tgz","fileCount":30,"unpackedSize":36191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQzlTCRA9TVsSAnZWagAAGPwP/Axrs/cS3HuscCrj08Um\nMQ6jrLSvOGUIloGy9KfrQVS5ACg1cFLjZK49oMP9uqt8uCyjrJvaLiekj12W\nIdRT5h8y2FWjfHNKFWiz5nw7y6GZVMyIJSBR4FbHci8kdK6bhOc06iDxq4yh\nuTX/uVGc2A2zpDbYSL4QrmsOY6RK8T0rVVWs7ZaXQlW8yd3Q8zCXvaWGzIYx\neYPAVBANmywiemc8EBLEcA8hahxC+oLAXNGf16PPevll/hYq9MAUun6pjySm\npUFrW94grr6VYe76pavBFP5o10hVSFnD06R9qHE+BeAZyxpOojXL5heNLhWi\n8+ag//f1HIepXvC9n7lWeUL4eWowRS1wlSZjf50CHwd4DzYue1Bq03jm+8kd\nV8KnVeTlxiu7WcOYKC/GfBhGHKEoQMeEXbqZ2ihB9i1Ry5NGe0UegCnf1unv\njn1fltxqJl1F9z9fv5c6TnqcFJriMtTEuIJSNUKicgPbryl++ZzvhAiF738m\nZTC5t2SGlW44EbJdrYvtJKegDxVSKAtiAI7HhYcOPqTJMyCdwyKNVx2bU194\nQU2ILbYgE2Lpj8/egFhlhuBuXBhgsriWVqeuC6P5r249ZlxJIB3BWVgwCBbh\njvVVEGBt0RdHMqNH8G3WRmrhg9IsEoQL1j0JJJUgDU+HKXfKmkPghe5a0/W0\na876\r\n=fuji\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTyoUuV3jIpeoCRg11VgnehWPXFllY3h7p1mB9HdErKAiEAm7JKThcGAh7ruICf/34JzBy7xueDPKew6mE+p6PhTMY="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.8-RC.2_1581463891037_0.5507460166443578"},"_hasShrinkwrap":false},"1.1.8-RC.3":{"name":"@begin/data","version":"1.1.8-RC.3","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.0","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.6.1","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"ec43893b793a9e722c563de80620c44da7e3f036","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.1.8-RC.3","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-pAXTxGPJ46cMBDXKxcZo6YI9mdSF1j4+rdJTf/k4Qa2Jm+KHM2rOASK9jdmjPcNMAQPrZjmQ6e95rZ5cLRS2cw==","shasum":"3147116289c8113d9aa4654467ab69a22ae60d3b","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.1.8-RC.3.tgz","fileCount":30,"unpackedSize":36191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeREcACRA9TVsSAnZWagAAaV8P+wfIivawuex+VEgKreTp\n/AzN9efHu169iC6n8O6tJ51jleylf+yeWoQQ2TSc4vUHiG1fRf8ursjmJ8CA\ncC5ND1OPp6XjExRrkX8zocykdapPHcoop/5AZSsAa2eXqTaQ4Cz6zJsCxR+U\nKe8Cvmpw8465CzhaD4jKSDTfmwFc5QqQtTa9LtbFDvoSvhRGijcqiFHUqppy\nn5AYeLkrEFyNrM//k4FDpWhv8TOFp28wHugfjcGnXwnzO97Ans4QWZfp5Y5H\nTVAYeIPDptl0PwmDecxEfo/1S+XCyQyKv5duSfHteb813Q4JBthp70O/IErb\neYY845c6tbyRQVymH6BPYRUnm3e1dv+ipjHNrxGztPKdxhpJCaIvx4D/z8zz\n10qIxNALDL8d6kXUoFJbFAR1QbOgIiUyMgJZ5IXVRI1wTc1NHpx2q9wrZTsY\nEAoSs5CKbTVx3TJScxmIDlswy2kVh0YflIYZN+yjC1ygjgJUe03qWYVojt/y\nJci4mckhcZWsBkvQdxTT+YMCJFRN9BpJRafjFQSid2CKAQ6DhUaCJj3egl+C\nHbhhHFvR2JVPduAKtaxtHS5DwPRp5JCB9TrReMmP6tuV5wYG8xNDxPw2AQsv\nbqiDKA5Uaez2XcenhdTA4QCcEMZc2xmkCZpnBgTl8Dmxqa/F27HHYid9GsO/\n/LNC\r\n=O6AZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCITpEvstSWANAQq1fUjRDrglsO83EEDoYpbwJlSdnvrwIhANb6ixltCh28uLpkCWT9Bvx83Wa9+HE+4Ai4jcezVoos"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.1.8-RC.3_1581532928379_0.5937182350423356"},"_hasShrinkwrap":false},"1.2.0":{"name":"@begin/data","version":"1.2.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.1","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.7.0","cross-env":"^7.0.0","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"6592bd60bb1e7a14e585933e5e6b0edaa651e2f8","_id":"@begin/data@1.2.0","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-3TSB7/dYa14gtDJRCInCNWvZvNRRJx8HPwk5dbRdOjv+FDa3iHnjVyBYN+hA87koggRZJJucXu9X34IKLGQ+hg==","shasum":"c922b45110446fe78555037f7bdc56d008f1cec5","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.0.tgz","fileCount":29,"unpackedSize":36899,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRFsyCRA9TVsSAnZWagAAP8sP+weHb7jbryg8SJR0zbMx\n6bY73zbJ+BOSJNP6bAHIDf2QNypjYyDKP8zBdzQIGNHSdW+MdpB/mj8fXvwY\nsHsgMLmPHXDQ2g0BsKNtvZeQZjqM/MoNaZSMYo8b2zGllpVNWvcfCAYTK4qX\nc2XCRHnpaKfIG0PdEz3nPvpZYRv99CBLNUYXIsnqLq9XVMUfK0jv8B6Jm5HI\nxfhosfijsfwuVf9+MgBsOn4pZTw0m2ExpB5gCBN1A9hwGZZRjQojO9CzRBzd\nd1AlPG/BzPKMsjT3iKmQbpG//tmdE9l70ibOtuIeSLxuKRwD60mtIOZJ4Ua7\ny7mN70u6erZ3qPel5oRG9ecXlFmWtPxH/63UT2tUoxtS7KmEQyliOdZM1BQm\n4Ereh7hRb6WA/ugJF/YXy8yFzKnDWqjLpoqFF92qOlzDSRJ1dkvkyVbFhbOF\nD/9mNgIlZhqnGgr3QeIGqBScAYzNBY1rEk4RFpr3AMYQmqRm5UXEXtz7cHyp\nUwDbkyccK5jVKH+NANH/f7yOyMHruYyYS5j0hljC2QFaBBtipWiZhWULFqh4\nMvTRc4rrtmC3XAIcJtZCCXTeQ5MTKuYYoGWD2zkbENP7pZuNtZzicJz3Q1Zs\nmg2V+EnIMDLlQP2dOO07rBhYCJjet5gN8RYYpk9N6PwR6MQ77UczOAcWYahT\niHgb\r\n=TUTl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrIQTdRce1gQ6Oa/uB0JqapzojIcLjLFVVmH7NS6BsOwIgcaSwzHsNd0AvsTYiYShxvuBmnzKvRr8UFkuKVhEQ6H0="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.0_1581538098128_0.7424686150711688"},"_hasShrinkwrap":false},"1.2.1":{"name":"@begin/data","version":"1.2.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.1","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.7.0","cross-env":"^7.0.0","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"9b1837b6c706a3dd66d4a1ea6f8af09c03297530","_id":"@begin/data@1.2.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/DzLvHb2GawlQlstzGf068mts4B+yGEwlP6jICfxEexYXxgWBtMZJKIm9jERnaU1WXhbrW1DVBBGWRS8yO9j0w==","shasum":"c5989736f5503e58eb6c66468a17ea6616a45573","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.1.tgz","fileCount":29,"unpackedSize":37060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelKK4CRA9TVsSAnZWagAAW/sP/0I3luK3PQY/xJiZxVAp\nfBBeKGnfbAOmWx7ApkxZS1w2oWmA57gGGTIGONafbINbgdE6ZiS1xHHOCEco\nUvStJNO2fRUUBRyU7iNpv0B0wi9d98ddf2+pFZr//kC+3nx/M3RcPBpVxFp0\nTh1metpc4ct4pYf8S1pb9igdkunN/Tqx/BfzSTj4PGPkoO33UJY6W7MgQY/X\nK9QF6d8SECSwyeC+xsE2VusxTR4hFwvvqnfNqWeOlTA2w6mscE84Y2IC8F1p\nGYYpBz6goMa12vXvlaDbz7KSgQ/N82HcYdzKdrFUznHDrP14PNE4/THKKHm2\nXsBoSHfhye1NdggQReOdbNf8mR07DFOzmmlmt8O8hwTQy9BNTD9VbdeLb17P\nmSFWhVxqdCAs9ZfC7jD/C9CdlNev07U2/Hsfe1rP+O6DMYSYyRI5XwShCIOH\nrt9oBZ4f/qgw5iae1ODxldinZBOh5V3pSVBTI2gXxlOp50U0GqvZvd7QmHzk\nc9x+4FFnpLqi/sOEZVWO+hAcNw6Zdtux8L6Ck/WRsXi1P4Aw3XsSjD4m1NzY\nsLGL3Uz/q5IxZ95XrezSARcK23hpdGLpKoPe7/FmCdQ1ALZNLs1L6b5M06nk\nj/YjROoiuaErFWlNxcfCXmqlHFwqFPGPwzYndYj5yQE+awsRogOeToi6xb2I\nUdgb\r\n=YJAP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDHinZu7B4VCu6gzMrC9QTX3VOgeXZmR0gPPrco7hjNwIhAO8EQiGZwCycrV3vaen+q1TCCI8pKMnaDPbt8Uch5uDp"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.1_1586799288107_0.2906025894242288"},"_hasShrinkwrap":false},"1.2.2":{"name":"@begin/data","version":"1.2.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.0.1","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.7.0","cross-env":"^7.0.0","eslint":"^6.8.0","tap-spec":"^5.0.0","tape":"^4.13.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"d0607423e9f68432ca72125ad2dbfb7a413c5083","_id":"@begin/data@1.2.2","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5YhW49JzwIwKleLDoVesMEzTNYPxH707yUiagChgnlhaCx4ikB1OINH/v+OPbM/6bAEaxA4gMy/Gseezzt4NiA==","shasum":"4753b984db10a42dee99c78669d14577dc3d3b7b","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.2.tgz","fileCount":29,"unpackedSize":37245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenNa+CRA9TVsSAnZWagAAbeQP/3Dc6/LtDHj5Iy+vZ/OQ\nA6zw3wbbnz7LM5Wti8mcuWtg/hupodIb1Dv4Z9kwb5TLmxIhC5vJ21nOK6xk\nt9+T4VK1ayvDDuGu9TkMgkz6yYrodMIGe1n94SwdTML8kgkiacv6Ohi4XKtL\niX0v8QHwEFF+bkK4wm5R0McAw2VRVwc5Ze9eGT0b3wuiI7FbJkHwpaPLgO1E\nZYKP3Akz+VjIRTIh5m9f/drRJI0LbFOuHRKlTASF27sJwRKCIi1fXaUj+rio\nSHfQWcZbdaPaN2erd2gis7q/W79Fcv4QZrHTPfyrJ6APMJ6gm5UL+oZzsY8F\nsBQZnzUfGaFmdxN8tC+kety0TN/0kEtiDW/JL+3caU4OyPN7KwTOHtni482l\n17F1iUmmj7cvfu1A6yGwJqKdtgwbXO9e6KI4fCGOccKQYfI+//53Y4wSBqa/\nvk9TUlZ6Xfp1kRhEu2qMoJ7rdvEOAwaWBSgFRTW1r/3mPTRJehLE0orr6oKY\n6Mxd4OUEJdnPjDq5Pay4n5EY3y4W9x2XjrKW3Km35nAHZ8cZDXQgkB59LwcA\nFEnLSzwTy9VUg0vr5USO4ctVU5g5fy17wugbQz8As6O9CPNJcArppQrZQIie\nBLKECf14Cnv9By7XduffMSBYbc4JMaSMs8kYw/4wmil19GkzIuYPFrmgFBha\nsBbm\r\n=xs4k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZUqcMKuyAnLeZVptm/BG7VkF1sNY722pkQM9ay0K31AiEAsxXMRg3vobDTH8RQYbgppBn74JEgbwwl/fRFR+VGdZM="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.2_1587336893867_0.3234377338354044"},"_hasShrinkwrap":false},"1.2.3-RC.0":{"name":"@begin/data","version":"1.2.3-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.1.5","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.12.6","cross-env":"^7.0.2","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"2b2a2dfd81fdab81cb5de0d6de1593c3138bc20c","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.2.3-RC.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-f8HXz+xRNI1x5uWjlDvyithclrJhraT8Bqr4fy4YXCRlCrXIL7N3/nOxN7DzyMIzXHu12oKl+uBt1PcBjHtsdg==","shasum":"56fb0e86b43bfe413a79f93c5611f564d888fe5c","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.3-RC.0.tgz","fileCount":29,"unpackedSize":36543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+CNDCRA9TVsSAnZWagAA5p4QAJy0y5idQlyZieSDKfSs\ng+UzlAkYWxhjD13NFrrY/0rchWJx2UQPK+H/aeEjPWRsrQDbqsWPaTQU2INK\nIAcwtBYivxG+QBAEN1zvTR4p3DMEIp3jai0qQoZdOBzlq18Hg8o0AE91RmL2\nDXG200SnuthRrRCtWAZrfi0rgYNSWWe2P5pPOWqRPWSRZ1ImMDLPbJnM/iCk\nm76smXaPNl2gqWes+fjjWMoh1ovC5u6fOXk2x/kcCs0TsB/m9rqoPAInbipv\nS4sCu8kHt8ggpz3PeBd+2dx/Yi3Mmo1x4hYQWxBEksvGjTdMKFEfpcnNI3GY\nE4PZ5tepAkTIaclkarkfroqrvDk+osUElcnzoPrCgnkPHl7Vyg42OuAa4lTB\nhKOWA3l8n+TWxNnGEnNQ3x8e+pQ1K+611cVRsadALtJhBckZ6G/Fb9Kb/0MV\nkaidW3cTniAn8pTREEntUuE1ZXd2CNGo/5aL/Ap9mC163krWxWLcJWNG78j1\nUs6fozqMl/ANt5CnWAgmCuZivPJwfBW68l9u+jRIRUZ3E0dAbMKhXUS8KVvt\nlXN3sALcpugfk+bNeRGJfFFerp3YyygghfjQHAvCuly8ajwOLTVyPytF9sKo\n/sRFfQIbaQxWfk9snRztY0KIlIaIztO88DUHcRpGcr62eqma242fgBoyMNmL\njy02\r\n=tKV/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoDm1v+98JFmT+wTLtwapBfa3o4FxPeetrPg1zTTZWRwIhAKTTBPOuK2eO7g7gRssRqf9Xjf1odsDu8Mvw2MVmkbjw"}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.3-RC.0_1593320258964_0.7252513051882201"},"_hasShrinkwrap":false},"1.2.3":{"name":"@begin/data","version":"1.2.3","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.1.5","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/sandbox":"^1.12.6","cross-env":"^7.0.2","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"d6f36c1b1df134e4230e383acbb8e2b4a1c23c6a","_id":"@begin/data@1.2.3","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-C6ITWRCbef2H2pIZ+PtYTES2d6gvhDnkhqg0rXW6FL1recjfASGpFtOcaohZ0vHuKxyFTSDnS1j3lAeC7AaCdg==","shasum":"d4eff3c0583c45cebc55d2c9a6756c8332029391","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.3.tgz","fileCount":29,"unpackedSize":36702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+CjfCRA9TVsSAnZWagAAhIoP/AtYSj8X8KdHPP6HXQuR\nC00d7juy8BtkVv3WzGdvlyFJjHRBaMf6Q/iNBoEzjF4tfJVBO33owAW0/wr6\nBTPyIRUr82WtlgGtHhi4Dg/gbBoEkUTmJaZwycZdVqmCr3xqwyJVIGQMZRnk\nTFDa8xnAO+RAFhp0jpvlkAI1H54J7XLjDyLuUNgyqalgyYTfcgy+RbiE459i\nd+mB/jSHFQKYGL90s/GR0o6YlK8ALtiqWc0dpqKB2UGB5uOEeTs/uqZmjrSH\nbq/UOGoLrMFCqco2X4KPY1JnYWZEzjVp2utO2e1s87qIFXVeOKmu/7Zo3ahm\nindFS+LkjQ8JQgMqz7kptcDOsYS9KyqP7sm10Bfve513XNLKYOPx12hbk2Nj\nPyT9TPfv4SaO8Tbz6t0b4jkr31Efh7KoRXsyBThSaTEW8whXZOmO6R4J8q+G\nOLj8GwjOZkLb4O1F/hGg3pKh/48ZfXF1za/Co7qqMqkE2lkhPCE4u3nxDrWQ\nV5TTy4aKw6Tr1OytyT05NeXAUvnSsENnTCWalrrMH5xKJbtDJm+zr4g1Iq84\nDDOlGzTBuD+G1WDzJjRiGXO6XCnaJXO5oiySCZ6Mse6UOUluOZoOYCYXJcBC\nQGvXNA6f8TUmagagjZfSUGLSa0AzfEzNuVKjaC7z5kH+3APj0hBJHFAycghv\nLg99\r\n=wGeC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFpN5gtohJ6ShX7E2KRRMhvu0NWxuMCVJLTQ2/p3RgWAiAoVPsn2r1LG/KHyz0RHtd2rhY8riDgcj1lATRMFmE3HA=="}]},"maintainers":[{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmUser":{"name":"ryanblock","email":"rblock+npm@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.3_1593321694991_0.8538031869603497"},"_hasShrinkwrap":false},"1.2.4-RC.0":{"name":"@begin/data","version":"1.2.4-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"deno:fmt":"deno fmt src/deno","deno:test":"npm run deno:fmt && deno test -A --unstable src/deno","lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/parser":"^2.1.5","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/eslint-config":"0.0.1","@architect/sandbox":"^3.1.3","cross-env":"^7.0.2","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"3eb1f2bd9be6a90b6d8e58fe48e604b72564ba2f","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@1.2.4-RC.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-P7rM3YF4C43QVDzsocro8rLTRArLh8xjmgCOIOqn8dGBRDUL2tXcFflZFYMi1X7mSb9zlNlX32N/H7WGz2t3fg==","shasum":"90500e8fcc169b6b1ff5d6d00fbef4706e51ed18","tarball":"https://registry.npmjs.org/@begin/data/-/data-1.2.4-RC.0.tgz","fileCount":29,"unpackedSize":37398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrLetCRA9TVsSAnZWagAA9qkP/0Z9z5eKEys+mCYNk9Lz\nKeJDa8wiBkI4uC5cCCb2E8FeD9Miv1CmJ/6Pm06ZxnWQmPw7o9F1lipR07WH\nIV/CCYY1ocNZhXPcdSlevCOlGAOFcOwQzWxeJ4DLRkwHGciPZqoAUC7HCz7C\n6M2dGu8XdJJscaKMDf+N+MdPaBsUN8v8FvaxcjXETjcNKyY2gITbA10ryQs7\nYkBargEha/fhAz6w1DdFJxF3NHzuAQlRhcSTHMe31l28pVQm6JGA00b8xtrz\nhfPfaj827oC6/6yM30fCmOZRg11Dk7x2O7RjptzNQI31Aj8dQ6QWJ966Wpq6\ngb8tUE+4OR+oA9L4BnUcWGnT5qTnvO06eu5S4GpbKO/R3yu8kPFuHoHJ0aRX\n86C57+FrTMmDcT3WGFLSY2qVOgzJRM5uB4TqVH5Hf+Dbvn/iVr1YPGk5XL6S\nM8luXjiSEtmIXGxdzKOxr2DyoNz830t8IaL62VDXI62McXua3R7qFF5ewmtr\n6YF793arS3UeXWR01rL71NC0fz/l/+2wJOf6kkCvdmhFjYw4o2/xWnKsMYpv\nuAjJkF2hXUeBrPfJoiREKcpeNYDi9y3wQMnJWXs/vzfoDEBkJzyYOsBKlD4t\ng0RPnKd/lR1pgutyOwiXlPFp16tro6I2rxqJws1U0euT5eAEukFuF+Wr3ayZ\nW0rq\r\n=KK7Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPMB2viGi9uKjrE0/Cjhpv0Ldp0NSlBXHI9WeNgJDP0AiB94v82Uk6bpDI5f0/Ugu9cfMkw4bWRmcwWGWYE9QBHFQ=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"beginci","email":"support@begin.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"ryanblock","email":"rblock+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_1.2.4-RC.0_1605154733112_0.791096195579662"},"_hasShrinkwrap":false},"2.0.0-RC.0":{"name":"@begin/data","version":"2.0.0-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"deno:fmt":"deno fmt src/deno","deno:test":"npm run deno:fmt && deno test -A --unstable src/deno","lint":"eslint src --ignore-pattern node_modules --fix","test:unit":"cross-env PORT=6666 NODE_ENV=testing tape test/unit/**/*-test.js test/unit/**/**/*-test.js | tap-spec","test:integration":"cross-env PORT=6666 NODE_ENV=testing tape test/integration/*-test.js | tap-spec","test":"npm run lint && npm run test:integration && npm run test:unit","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/inventory":"^1.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/eslint-config":"0.0.1","@architect/sandbox":"^3.1.3","cross-env":"^7.0.2","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"769b941cab47185b72122b4644c61abf9ecb0991","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@2.0.0-RC.0","_nodeVersion":"10.23.3","_npmVersion":"6.14.11","dist":{"integrity":"sha512-Tuc7wAMkdcgkGXmqLO+1WlZnIEgJutWpo5kdpHAFDHQthfKXBPnwP0t1QV5aYOcQk/3EDrO2oyLrJsC5ckbnUQ==","shasum":"4dbad4c3321a11b22deb718d249b436e147f4ecc","tarball":"https://registry.npmjs.org/@begin/data/-/data-2.0.0-RC.0.tgz","fileCount":28,"unpackedSize":36047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgODbgCRA9TVsSAnZWagAAxVAQAJsySKxfIdFnvCx/AXHL\n19j3xt1+ybEy/7nMK634ENnAdzKkZkxKp61OpZBDdzuFj/syYfcWDoDzRvt9\n3odwp7X1bGBTYDNTcII0sp1x39Lf4F63PgJgo7xd1Ag3AAi/qXbNhKE5kUM5\nl/ilWNKbY0Y5dnmZT6S4iscpZ8Pnc63GODhSwk6rAH+8ZFvTAhKQP/Lt7Tm8\nTjNaWTH2mN7AQn6Q+u3xGaGscVSxUfY/cwD2uxaoe2edkvCjsA9z8P26I6Tj\nsTPJQHuLXuT+P5P56Wn8nyExgmjzQ/sweTov2vif4J7m26halASERE1drypM\nnqpaXZCHvw2uC+MqhqYkruuziXSAtOLIZYDEcHMZMycA7jm2kUQQo80YW3f7\neKzVDDOYfCJ29zQDRBVYZFfj+X/plzAWnijr+GgNVMVmsxNF4RYQr95fL8ep\nGSdSucQY4ZW4lNEbLcpc/Ks8esTR6ElbIuIgZp1bL5SiD7aCBVQj6CHheDS7\n2ZYDIHwDu35swqJ1BagkjYZrsedhbpJKJQuq14lDfHYde+ioqzzG8v4jYLqC\n0IAxXvpgeowX4Ow2x3UltiLseOtwyP6pJN6LpGF67X/9oEt1m+MZjxDIB5HH\ndM8vUda7IKHogVWIPAp3SiOnyAhurgSoyf72/KlAj5XhgT3ZRmXETawDVLbw\na4oX\r\n=agqS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICD91e+0GWocD5Pj/BKKnWyzxeEBn4lcXy38XQjD56x7AiBCGBvuZ0KfyjAsgFwdUWIU+hbLs32q4z/pF2zByhur5A=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_2.0.0-RC.0_1614296799815_0.30981695630335193"},"_hasShrinkwrap":false},"2.0.0-RC.2":{"name":"@begin/data","version":"2.0.0-RC.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/inventory":"^1.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/eslint-config":"0.0.1","@architect/sandbox":"3.3.8","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1","tiny-json-http":"^7.3.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"61f869e47d953169147439c28f1678dfc7ff3ee6","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@2.0.0-RC.2","_nodeVersion":"10.24.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-PiN3sYYP/m7gEItEWLMyTkv8BecPT+wZpuSMw4V3phHE6Hu2dx0H+eTIvpvWlFf6IFFoF8si21lao61gPW7N2Q==","shasum":"be73e70301976dfaa1135a832eb629a9d2d1a232","tarball":"https://registry.npmjs.org/@begin/data/-/data-2.0.0-RC.2.tgz","fileCount":28,"unpackedSize":34855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU7v0CRA9TVsSAnZWagAA8CkP/3z5ftkzA/CTJV39y4KW\n0VoXUgmg7UJC3D1JglomWP9j22k9WyisHgTNTdUsMwaUIOHPgQyc5JdSMriq\ngYTrBXw2bKT/zXVDj6CjCd+vzZVT6gOh6mFetE+y2ooVkXPpdR3ktZ9MZlcD\nlA00IX97tvjbZiftfTbxlikVAlKIc6qe7x5LYQXibfnBEFymFxWQPyksdy8L\nHQuyFVkiImL+3Y4Csa9JOhCL25slaggwAE3KnXbU3a9Qs5tzc3LCa+EI1wub\nKYWGyAbbx+SzxTP8PCe11nX0mAoeL8zEqZltHG86AGSOK2ZZiYbgTKcDoh+H\nWwN7uLPF6NZAkFL0N5QjW1do2clPfJo+FC8J8SOcjxNIS35L93+lhbE0XSCf\nbJoBtqIGlcEtl3b6UOGp/fN9kpfWxnPjLNp6sY8MV6n8vzzvoWPS7oz85xiZ\nDpcv+mJ8UC/JyJSVqv8UtnPgv/v87rWyiryDmmTklw9o+R+shh0vVLUgGKIL\n6P0AzUNGfMVSF2uyhNP1zX32is7oXOPMDVk8TMFN3sEjse9x/zU74FgtRoKt\na0ry/KXuLvKmbtQ9K+qZzIElkEjnbpICg1qQvymwgkSUYwAsPqOdD76+TBbw\n18c7hsd1xccUAjOkn418s6ON5x0EJvbZtQzTiPDpYqqUoKQU1DzTkfAo/VFi\nhH9V\r\n=Xc9h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFKfXcXEzOmljv1b8aaHGMHP+TqP4IwGC4IXf4l9w7nAiB9vLUV0WAo0JzJbzullDy69ASyMvW5CZbFOs+8w/dNBw=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_2.0.0-RC.2_1616100339818_0.3209893841517133"},"_hasShrinkwrap":false},"2.0.0":{"name":"@begin/data","version":"2.0.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/inventory":"^1.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6"},"devDependencies":{"@architect/eslint-config":"0.0.1","@architect/sandbox":"3.3.8","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1","tiny-json-http":"^7.3.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"86d121a15a33b69085b42778d2aaee625736ab11","_id":"@begin/data@2.0.0","_nodeVersion":"10.24.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-f9NlC3AfhtIPjyiLZgSRNw7DuQC398D+tPe3ejn2V8R8DJZKwVdEaqpxMkpbe+WPQhkjs2LDb4IUSUYNt5Im/w==","shasum":"5d174b798323d55abbaed633b4241f9eaf4bea88","tarball":"https://registry.npmjs.org/@begin/data/-/data-2.0.0.tgz","fileCount":28,"unpackedSize":34850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU8JaCRA9TVsSAnZWagAA/jcP/RBDhjDWNybX1YFHndJW\n5bomhlQGWkuA9wVGC/kKKlbIjpNXOlmQ1O/WhGUL/Ql+2BvIcsHQQ2+Ary38\nLtfN44zaHj9nyJjhsDUkkZidfTXNeB3I9BW3/T3M+4loBEYcrm783O8qLF7c\nOFau9Xw5iH5MDAas02iHGLW/CTeqejMhPvp3xHv6d+Z92IaNCkXUXXSqBgAf\nyUcFDlAJewOYsd+ySU3+ydfpvyZNmSPDM67oeVv9jSOz/ZiSnQ1CrbCI/rFO\n/DSC8Qz1QLtw5r+HDyHeL6AfEmTjNkm2pnpskzxEBcigeDWpKRA3iItl37Yl\n2XEZsZvNKIalkaIBfy6tpOePxpZ71mjHD6qaorudnts3edahajYHOPug8o80\n+1R7AGSm9sfO9bFDoMVLyQfQcRwTEv/Ds9CPuoDl5WKGPmhrC8Q9o6XWeMGd\nw2s7Xh14Z8H/kUnbMROTGoYmNcpZEszjqoy+rkjTKnAr7oH/Tkhki1bS4cXF\nAod63qoEUiPxql4AwUCFEoXVYNXvl5fKCgLfLLjNpr/iXa+tKfQgjomPyOgK\n782ff3KCB/adJol4bSAPpjpJBCQV6Yn2XNLUcbLtKRbyJNhMwEdcV2T90nCH\nrqnzTmF9n3N00IonJq4KzdQFa586LffNFCB89ekldw75mYEpijxGakG4gtES\nALb+\r\n=zekU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTUPCTdq3xLStyWoeh+8BvCZwJXmVMbGZLS/wIpQNxqAiEA0+BQ9o66gVbSYY5skAyi/sV+TcgXRTSDP2GNLN1HXQU="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_2.0.0_1616101978419_0.1262167695704326"},"_hasShrinkwrap":false},"2.0.1":{"name":"@begin/data","version":"2.0.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint src --ignore-pattern node_modules --fix","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/smallwins/begin-data.git"},"bugs":{"url":"https://github.com/smallwins/begin-issues/issues"},"dependencies":{"@architect/inventory":"^1.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.1.9","run-waterfall":"^1.1.6","tiny-json-http":"^7.3.0"},"devDependencies":{"@architect/eslint-config":"0.0.1","@architect/sandbox":"3.3.8","eslint":"^7.3.1","tap-spec":"^5.0.0","tape":"^5.0.1"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"7b10d22ef2da9d1f6996bbd310028ad4b9a694f6","_id":"@begin/data@2.0.1","_nodeVersion":"10.24.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-n77JNHAHWSscsJQwt/4A+KKf4kSXvK3m6QQFzo0UBVpuUd84g/nL72jF8+t8QD21AFf0bMPpTAhB80sJu5ay7Q==","shasum":"3d9fdce59c5725bd810559c41547984b830f8ae0","tarball":"https://registry.npmjs.org/@begin/data/-/data-2.0.1.tgz","fileCount":28,"unpackedSize":34850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU94UCRA9TVsSAnZWagAAP+QP+QH0PZDy6HjQo2re/LAZ\n703OMRNnRBSxSr8gg3uWsIN6lRdk+9FlzyciRaHVA5Y8OxHBepRCe+2kD7Jn\nwxrSwZYhAEZ1EH8jvAxFbpYkV6RYZ2UMkbcXZ5XqD82TSMWCs7gdOQ7BFZOz\n80VWKPYOsvIwD7dXTBJhTeaSw7WcoLwHLk36xfbF2tiq7YoA/yz/BEZHf8Vj\nm0lMY/Va80row6olwblsVJqtti9lHvOVHTrxN/Xyl2zKFNecxc6syt8vo6BX\nBjeJh9YBusgYDjUFceMLkJYZA+kFct9yVCcImfXJRE4oQYlJ7qpVP94PzoGr\nXEkBix/ndSWcWlaaXvSK9ZtlzoujTBtWAs/vit+ukoo9MAThTH4aA2BwzlDF\n5Vt1RmQjkboIa/DkFlFz/5PVtUK54wxBtmTLqasAW4Sl0rrPrTbmCs2U+E9i\nObJ1ipgV6Yz3snl0mPgJdVgh4BUsdxo63uxcK7h9JHHlB62uO/ESif0zOpnQ\nyLibHGS2hI5fM1Nw3YKa/XsppDUekecZveisxAq1uJ0/vnfBUf7Gn2AOzr8t\n/8NvVZXHPiChy/UmO+h3I2FR3RGOSUjp2j3rnJZb8Tvhn4jJAlkgzVUgrYuq\ntqYf3Fk1jmoeeLpji/ghIZ3ASFVf3Jv+xNtIvp7khTlxykBOmetCsqGRKNBf\nZ4Ml\r\n=bMEo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAD1HPc/lk0WI7DoKSMjrFjZgEDAhUH2040hjCQd6IJtAiAGTh0Oe59MqJkInhUgqFKDoELAIyGwArS8j/SC3mt3EQ=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_2.0.1_1616109076269_0.8670835552483793"},"_hasShrinkwrap":false},"3.0.0":{"name":"@begin/data","version":"3.0.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"1.0.0","@architect/sandbox":"4.0.1","eslint":"^7.31.0","tap-spec":"^5.0.0","tape":"^5.2.2","tiny-json-http":"^7.3.0"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"eslintConfig":{"extends":"@architect/eslint-config"},"gitHead":"ed25f234f23f6119738f0aa2653642ae26668b6d","_id":"@begin/data@3.0.0","_nodeVersion":"12.22.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-IU/SHWneFyXxdBWL6/K8+BtUBgSMaNBPBDPCcjqCx0MHftulyOcAW7qgMKlckrF9rDpV+DqyVidLq4HFhAKf/Q==","shasum":"88711d446d8b0c268428c1e3a41eec8895f73c17","tarball":"https://registry.npmjs.org/@begin/data/-/data-3.0.0.tgz","fileCount":27,"unpackedSize":35052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7vhCRA9TVsSAnZWagAAAskQAJwXvpW58YIlpZaHVrNI\ntPWlTSsj/BebDQs/tI4HyOk4ca2vDMxZAYOr7gDlBCJinHtPD80iGVDjBipc\nbOeC3ln17gQbHpWRHsFM7446bTUiBi2fK0VyTzZ//lngk9TOxIDvwXD08kSx\nknGtdSQC0ed5ockryclU1pcdQylyiF1LVFqZSjknJnTz8Is/6i7X7p+fOzwk\nH8FKccY2l1ZhtfKM/76o2e0+EfmxyjfOoXxi+E4XW/nfGj4c3OMxq7CE1VKA\nkQU/cFeiCigONEOnk04/D4ma/nhLJnzOzZioFHv/SwGV9ruMjoy8O4bZ1q2g\nj32q2ZRyJRpsX1faL5rDwvpd7dDIR3PdlUWHmEdszqVoolCHF10V+8n2cl40\nuz9sU35K4cctYHIk25fMeHIoqPps+4rwg7j+r/BMfG6mRgmexmrNMjUG4XN3\npYGxZ2eAAzVAB/xzUexhvol3roFwMp/ehdOC/+UDiECTgrZobtsmqIPf2rcM\nVP7avc11Ry+z/yDu9/WwHdpF6gnMkvdjeXJ5bF6RNjcIA9VB3YF7f0I/kN5n\n49QVspxWdabBox/hVZ1ZDHjemJNZGnNllvD7Uj/xrpFov1BHmj2q5tbsJrjO\nj2mlL6FjsVSL0q3gO+6uo5QKkzB3wIsjzMeGrXRg7MCw8G62TslTba8XPB1A\ntG3o\r\n=EmZk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+R6yVUQrFKUle3yuupRkrwqs/F2RdlyXDCM1Nufq9XQIgMnt2XI/3p7Isj665aDQL4g4FEvQ2xWGXnJgyw84LxzY="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_3.0.0_1629993953263_0.30623468924921227"},"_hasShrinkwrap":false},"3.0.3":{"name":"@begin/data","version":"3.0.3","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^1.0.1","@architect/sandbox":"^4.2.1","eslint":"^8.0.1","tap-spec":"^5.0.0","tape":"^5.3.1","tiny-json-http":"^7.3.0"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"a050ea519da6509c2f1d393cd860e848b24f520e","_id":"@begin/data@3.0.3","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-+Lu2O31P5JHWyUeVNokblycVLw7OjVroAITcHWSssSgP2ZAEymAQq1IW4SYkMYmN3oymbUi5dd9Z7qL7rLUmMQ==","shasum":"9475f7f410afc0622f7a02714b3cc246a26be812","tarball":"https://registry.npmjs.org/@begin/data/-/data-3.0.3.tgz","fileCount":27,"unpackedSize":35331,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9kFl1y6E1XpgU53u0arkNiOZlas4zcfbOZB0+JNjvcAiAV2bE1LZW8wqzx305qsZ9bIrh1x0gJ6bkP44DeOtJR7w=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_3.0.3_1634233474931_0.47347775536096104"},"_hasShrinkwrap":false},"3.0.4":{"name":"@begin/data","version":"3.0.4","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^1.0.1","@architect/sandbox":"^4.2.1","eslint":"^8.0.1","tap-spec":"^5.0.0","tape":"^5.3.1","tiny-json-http":"^7.3.0"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"09bdde101d6c5cb5b407d0d54777725474c87d54","_id":"@begin/data@3.0.4","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-XkOVlnEThyETSDOm2++JMTygl4GBQIRCZaw9wi0cVhpOPR5TOwcCcgGs0dHpmzTMhQ1m78bXJ5mVqk1d7VhZMA==","shasum":"8adc7f0f783dfadd1e903508f6244d300b44eae4","tarball":"https://registry.npmjs.org/@begin/data/-/data-3.0.4.tgz","fileCount":27,"unpackedSize":35598,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzHfECRA9TVsSAnZWagAAi/sP/R7RSiX2oMw5en1Gkz/a\niGsnkyRXKqgXkMJj/e/Pq0r+uS7EZjvXXq1IvxM0zDH4ygqxyCm6mCIqJ9b6\nytIXxcBqPvtO67ttLoOoCMXqH8Mtak/uBULHdcsfk9VySc+SI0WL9okF7zNz\ntRp+eM3+NTZFOaGI68qNf0Ftd9h3APaVKkcvoBMx/H/SFl/EA0DNkTGaoKpF\nfs2Qwe97IAYlJtoGmCgvzC44CzSb8xMnrTj8X8d0AAyECxhyNQgiN25lB7ns\n9PvKqLKonNHrDG+g9cBKzQtcl/LnenGPbWlrK2wCxKmgdIQSfSpoqwKrnLKy\n3MgNYeAEie5yxCGHlr8IcI+g9DpnY+lvIUVcca5A3p05XRAhWfxdT/6i23OX\ncrzhxojfhbiBKzxyHrLV3ChRyXEcqFG2ycGeJzYcwiSUGN2Ija1VVsG9uhON\nhnzPqoxaOGV1aOfV/U7KhqVRR/73B6FggerCpEmmbfWch3gO3W1HdQgqb0Ek\nXMA4joMJX8rmON520y9Qem1CtMD97EiRv+yeA2R0ONC7CFaXbNvRdqlMm1tp\nBGD8iTZ6w0RCN8Q0rsCGebIa19MyRS1uB0V26fmh2dogN/Jm4p6gK3hePDA2\nbTLnkw8UYKpsfKHdBcRdEgKVo05ByE/cchCEycvGJFbY75p0gQqP3A6H08NM\n9kXP\r\n=1bzn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgYAvqOPEGqlEpGtE60vVBeMrMKmtZzenLQ8vrg/P5fQIgEE+M/iH92KVipcV2A7l/xiH+Egq9SBlggJ5AKsjubOI="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_3.0.4_1634587459525_0.6371055687928651"},"_hasShrinkwrap":false},"4.0.0-RC.0":{"name":"@begin/data","version":"4.0.0-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.0.0-RC.9","eslint":"^8.8.0","tap-spec":"^5.0.0","tape":"^5.5.0","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"87c818eb01ff165fd5b86412e64469a7e28812f3","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.0-RC.0","_nodeVersion":"12.22.9","_npmVersion":"6.14.15","dist":{"integrity":"sha512-WgKY4kCJV9NiKzgYnJQEJe6s/gaGBjSuuMhjYBqX1ZrB/NalJ+/gbLk7Y/Gva8ePTKi0hyfjEbplruAq3Kwx0g==","shasum":"6b1090c34e8381b47fe54d4f35d5ded6d8feb180","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.0-RC.0.tgz","fileCount":26,"unpackedSize":35432,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAXKfCRA9TVsSAnZWagAAri0P/jfe+6Lx/4KLwTynpbzc\nV61UrEa+/9Jyh8MhKlIM5OiJxs07n8h/EAIH+ABH601XyWi/v2MvEZrSU5fx\nmaDhyxy9XAiw2GduwFAs4L6aBGeCtAbxRtKooOpFTw60ABqbalHlSjoUfoMy\nTg65/PaDdkdm3b/bxYWj16r6ak3sw4lT3g7pxaR34nvu9fzjq86H/138VBpj\nJqZhDXatkvqztSuSs0YonMMukDnd6RPobLwMGPWfGxkws+QPTPb8Ef/tQPNc\nSxrKEo1EApTcpCW+ydH4UQjoYFhYHUqUMN0T8vh+tEzD9GyfY1wCvIUuuspG\nUB9AjQS6PzS6h0fDEzEdQL8ftTKUcOvX5D7jb7k2e2F6+eJOZbpQA0PU6D2J\nqs+WwkX/hvS/01oo3e+zRRnxSENnYky2qXabh5uYuZCR0tuIRymoLwC/foue\nUYL0aj2jmG2jidY3lXf2rQxN3vEL0pFoqoAjFfpyyIMZJRQQea4T2UZiPr5X\niIjXxi9Q0Mf7WdC1GhXWBBA1YHLEFanq30bcIPWCc7DI1AhudukbhKzaG2rO\ntUJSEgDYt94VdVyunMbGKE4jpBk0HL/2vC9EB+Uu5w0s2v+kI0WViubb/UCT\nYxdIRTBd5KNllNQBdS4nm3kGZCiUoEwEOWNQsZ+K0S5da1FQwlJpl4aFeN/u\nRw6V\r\n=P6Sq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8+Cn+g0j2Btef0ZbPLfjCle6iguvWkXWbBV0p//inMwIgeyVAro5rA7WEFKf0jmsTnzw1l4VkBgnAc4BP4lWF/8s="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.0-RC.0_1644262047709_0.9461299511876686"},"_hasShrinkwrap":false},"4.0.0-RC.1":{"name":"@begin/data","version":"4.0.0-RC.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.0.0-RC.9","eslint":"^8.8.0","tap-spec":"^5.0.0","tape":"^5.5.0","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"6dfc9bde7f304286f6ae63e75aa8064a84c2b68f","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.0-RC.1","_nodeVersion":"12.22.9","_npmVersion":"6.14.15","dist":{"integrity":"sha512-vuWjSs/bzn9tZsr705cpg6VFpM6+L3aeh2//qDm6qnctPFTnwAqeKJgaAQTgderxw6TpaDrbR0Hb/70uKIDRpg==","shasum":"2f2b25912ae8840ccd301b7e359f4ce982bbb2d4","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.0-RC.1.tgz","fileCount":26,"unpackedSize":35425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAsF7CRA9TVsSAnZWagAAzCUP/A9AtXGQ46L2yAA04dR0\nXoU/LC3EtsQX/1RqHcEa1r7GmXDLRdNYLlOzYkoI6hM+7YIG1pQ9X03ClLCw\nr2MGq1Tisg6MKk9DBPzYVrSgLAO6VC5pjTtIKT5vn+uJyntyCcQ925Fmhxu5\nX0XH9yDfE9RnnWDi86Ws4A6/GPKdQl6wiw9xKuek6JOW5e5z76lkvNVB+lM1\nAXu/dl5rqTJnn+TSgGrz1LH+EDB/ikZUSGSqmRS/Q0IjPpjTE36XfeuO8Mwk\nWeU6ZA3IQUKaqaU06pK7CAgTZ2C4tSfIt2xgfXkwKGLoO35W5GkpW1K2ZB9b\nmI218HO3tOCsoGNK2QjeteHTY6JfI/mBv0+ZFVZanwbvtqqj93h5KHasunrF\nKGj5Bv5fJHXNEEz4u6VW9wgBnY0Xf13CaNwEP1c2ii3rxN6u2A1kDCGkZzUg\nZ/CMze/0lIxbrqMC2rxylhDQ4ZWMgbamfU1xoDKFMwzeemYyRUBpqmQwrLAt\nEMg0u/tZ32b1EiA0GgA4IX24jL+2vt8iPi55Z7RSYKs/JslQ+hz4MATBZD6v\nzJSGPr6lK/ybc2AoHxjGxbJU0mLFTKjUTTHyolWz013gtwS5LGS6oUpBoIDp\nPjB1aGusdQ6Xt6K3gjalwZzmGclSv1s1MVJJZiUnxGI29kgi8KALQ9Vw2Hro\nSHjT\r\n=0iWY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmx7p/dOzLy45BAbB3CTik4mkU4KCmesyu0ZjTLZyEZgIgWfRVVX81jowTb5a8CtYnteiJfeVQu9mBLQD26CVsNlk="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.0-RC.1_1644347771446_0.8709699153419566"},"_hasShrinkwrap":false},"4.0.0-RC.2":{"name":"@begin/data","version":"4.0.0-RC.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"4f5a76136cc890621a4def8e0611c881fdde64a9","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.0-RC.2","_nodeVersion":"12.22.10","_npmVersion":"6.14.16","dist":{"integrity":"sha512-eyIGm5oUznF/enMGTi1/kd/Fcwr8WsPqZ/J+yMKfV7OTO0kH8T53hiyvvewWDfSo2GuEfld8K0nghifzqtdhkg==","shasum":"2eac1b632fe7333e84cbb4d5c0efa8e7339fcbdd","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.0-RC.2.tgz","fileCount":26,"unpackedSize":38320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiHZXAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrTrw//eXt7jm/bIuO3EOozVotaSCntIXoM9Wm/OhF9oPgrrlR52wOr\r\nahRD7W5E4nYI3aDXWXoBRiBkKUDqiZjuMqv31Onj11pNDbYqy8v8aOlNRrpc\r\nw4Vm3W79do8n0dPEzH2BgL+wp0zPsUuMh6LJomQnYHNdkMbp5AZ34TuR4xJt\r\nUFVuAsm4ALuec94o+Tm9j0U8EvBnuMZFFGl+80X1s/kOOeP/+al4B3jsXKGJ\r\nhG7fqkVDIUPpfP5wJmGUMhN7IB0elHUgpn5FsF7ny0egV4e++NJkDjVR4wZL\r\nE7TULs4/tO7KhHGYt39J5h5QEfI+yjIu4Q9LtqTXcv+YlGScAdJlgJL49+K0\r\nEz67TObxaliX0UaxuqqsoqBijzlWE/kxopfccI9afxU8QLIOX6X1McxMGQE/\r\nQlexJUb7KCpYt3vSqwQWfFA9F98gkY6f8xN9AwWPKRh9Ay/3iYUyxGqL48Rk\r\nxP6BlYdhsZlgwb310/uGAJhhR5f69dHXFG0ULVQN133L/h8t9KNLKsrSeFpc\r\nrKSMjxAEm7E0hJ9D9OPLWCJ+eXk8wgvO4HfWZFCrtkVn3H6WeSYJIjAVVO4a\r\nc/gWvI0YlCXfAWTzHw4nrFW4lTghGGcfmKCP3LtygSpBRuHXsiz/9CjXkIPY\r\nbQFW7ZSMwkQmwD3n69kxTaLFtK+eHN64VE4=\r\n=qIHM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmcw9A+k7tUX8wYOef3vwuU7V4uG8I6WImghlSoHlXfwIgZlONXecPJ+gUcpEiloSB3JNAeOjpRuEPspRTZdrZgRA="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.0-RC.2_1646106048281_0.40428466705686184"},"_hasShrinkwrap":false},"4.0.0":{"name":"@begin/data","version":"4.0.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"d96a29bf326bdeede37e8dd49d6cb0a2a11cdac6","_id":"@begin/data@4.0.0","_nodeVersion":"12.22.10","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Qfz1gcdPhnIRCNKI6b8mh+etC59tZTuFz0xS6X6JwGLODoY7yjfPG0QxiCt6yaurcPE6EGRwiHICGRuwSrT4pg==","shasum":"fdd4867d76b9db61ad0ab7f18d333aa9d536f60b","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.0.tgz","fileCount":26,"unpackedSize":38315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKoTKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqK7Q//fpPu+mnksVnxfNNBl3jcS7NR8IuKT9KdAoDGqtf8NWohO7lv\r\nbvEaUWuj5bjA+M3w75zymGyg9Ybv/dBP9f8DU9kQRhzuqlY9aX8fukj/ncDv\r\nZj+J88yrajUalNv7qPNjzvlAYLmdPDjGt0m28Zsf8H0H1ARWDkw6vgbCAqD3\r\nhohif8OsyEOwfFbc2/p8XGkuBqwL78ZpcjhTKpLnIeSAiFZfC0mUgk9taNo/\r\nqPLe9P1cAnuSISMxZ+TCGn9K60EPQ3ngH3kFTPBvq1brqorlzMnxEjj5XO+Y\r\nCJl9K+UPgYS5K9CFIgqILMU23iX5YmjGgOFNUdDrHfaJv7l+dskQx/+r1cv/\r\nVbEsq/CF+vBGcmq6xHGq7jc97Xa7pYJVPat0GtcLY7t+DasVePOS7quGYsbD\r\nz+OWQ3Qci8nzZASAny+sl+M2g+5+mWuxyYwK4Ley7gDDfErzhgF4qACVvuHs\r\n/9pS3t9mItJV1FhrrjAuRs47CrBwEIZA4JlOCsHzER1yQwQ+wsEN9msoW+qb\r\n6N1yeE+drEVW+Lr0Tlw1hXI9J+kao4csDTKZbyLQJtSl12+X1qCrEM4xeTMN\r\nj7+snVyU6vPcgUl4PzFKkAGsGF2C9/fTec41ajm8ZwYzH3wRA0vLGzZcI6zn\r\n1RIUP1788IUR56A0Dbjx7C1lR1UZOrmz1lk=\r\n=Oiqf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHxi3gufDMmzjVsosYmbb8jVWuxnRVmXCtFLL5Dq+TgQIhAIUmS21R/OYqzvZQSOh5W8IKr2NlLnZUscbKEIZxnpdz"}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.0_1646953674563_0.07683628371146844"},"_hasShrinkwrap":false},"4.0.1-RC.0":{"name":"@begin/data","version":"4.0.1-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"95cfc3a6bc154bfe3d118887f6650168d46abdfb","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.1-RC.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-mFoZGm+3fOX8Jdsn3Iw6AJZy8+51NOIvfLFx31uP55JNLGAuAXnhhDh6qEhBJn1t6VT1K0iHb6jfA3yKQ4YozA==","shasum":"7fafcb7efc39fb226115b529a9f28ee1daba4a75","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.1-RC.0.tgz","fileCount":26,"unpackedSize":38374,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+1wvc2OkCiVOubhZRGAmfkyBf3CtTwjHEC/MwAW3iOAiACgzNzfCuHLVoh8rZ6H0IkmNTD5YlGYyShbiu0GYEeZA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLIqjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrrig//dYzDG3WzH8uNZNh7ovIuT5GNpEOen9H1jL9u0pT8MI0BxikX\r\n9rfHF05B3ys/PaGkDeRRwWGBP7al5Otxlf1YybE2J97fTvJjoGF9WMBx11Qc\r\nhXHI7oFjGDhsWGTQ1b414DpbqcQnc2mL6CEvkCcCdCRH0oa2IXwkZY7sjD3F\r\nWy4WX6QHQeWUr5ue/NCc4aJGQv9XGS2OpS8fj5IrJO2Nfqs7XpdztOX+XEVQ\r\nC9vmpzz9hiEGHYlvx7KB2N8btLdEXLyNgL2Ni3ayXUHRDos27aGv+jky+kNW\r\nV0xXjH50HvqQHSQ87DHCG8JNsyOE61qGtMRYEyC9EweReGbNLcldj3XM+OrI\r\nubGSCRSvoOCaBRxCeTPHzFsPjwulXmTZqwcMmCgRf4F3veoNCmOvLz3dbbR9\r\nob2lcjLsHgWqBG+a7S6VMU9hX4S+KXCYWYhJUuwioo83ysHFjQuTko3tuORs\r\neHHkkyt/j4dlWNNSn/kzTICnS9wJ5DgYEZ7PxU35ali1DSAAnDitlw2GAcNd\r\nWG0KzHL4Ht7zHvGNz9oWVd/iGI23UXwaHnr/RUyLurcUsuZDpIC2Lf/1oSbq\r\n+GBceZ0qTrup3BTn1ku3XMeTWLsS7k4eTy6VzvnKwFRRWwryYJ4lp+xdFNTO\r\n0cQHGpZZUCVjz02zDYuYImJiqXbtt8avKU4=\r\n=Cdjk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.1-RC.0_1663863459542_0.9148977785838543"},"_hasShrinkwrap":false},"4.0.1":{"name":"@begin/data","version":"4.0.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config"},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"6226b864b2b104810ac6fd47d386b0638ce5a3fe","_id":"@begin/data@4.0.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-XDzTJyYrizQrkHtnmG5s22BUvVCAy9X9h87Ar3Zk/3/ADu3WGWRmyteBYMhadZc4b3tHHwVEyjrf4mBh3J3gdw==","shasum":"15a73b19d7a37f677d37771aa1c6494ef5b6dfb5","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.1.tgz","fileCount":26,"unpackedSize":38369,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVuUdHjN+Gvnc6RElkyg4htZK1r1mKoXJkDrsVYRT+3gIgEQZmaYzNwZJU0i8nqIp5nYwS7Bwdveh1+IyLlbCnej0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLLMdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwzA//ZbhsCKeDP2xsFhpTJkTUwNeyM1+GEaWoIMon2YnIRg0gSqrL\r\nO8EXmT8UFnixYMok6iwMplpOuL3VYiTK3RfVZXm4l9oEjj30n3+q1ojPQqGt\r\nrEi8YvarXPpNOtZv7K4mdatiivjKkmMBcgPENQ9MEzEFp9Uc9Glnj1mANXCv\r\ntPnad63pHhRzmDASq0SVreq42+vagJhR5YZzrJ7uaTdJJ4TTC65Z1escrYrk\r\ns7TbpGn5UxUH/6rkaRoTNE7TQ9HzDjTlrH0pGqBtCT5yUceV1HCCy/4DmXw9\r\nmn7cXEXI0JiJ16cLKwKH/QDQ7zT/FnbTx88bNZuUf+HBwiVYzI+sBOWp1U7/\r\n8tg4Myt4QmFmbFNrRJPayL7kS5H2WB2vj708zZjr6NMTLRNRs8fHsJ+5YFPJ\r\nikM8FxPrGiKqdtOMq2jqr8uMleqcZgKyMLYu7BQ8pSSyCMvegqwiIRlEq2SH\r\nmGwGLJzp6smVzW759CvOnXO38gKzFdH9l9nKpwm1KjkUfCns7MC1BI0KIiuE\r\nYKfIhA/hieA/74E+kehJ2gCe5jd3ov572Zmis6sRhi47SzHmgOkyiUIge9JC\r\n7J+iicnFcUWhm7Qia4oM7uZvAKR5Irzmo29XcjDZd4+jOEL087NzSSia4nz6\r\nEwhfBoAPY9AcmUtSSUNrnLgb9yHLsIElKf8=\r\n=p94Y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.1_1663873820980_0.0589438967952185"},"_hasShrinkwrap":false},"4.0.2-RC.1":{"name":"@begin/data","version":"4.0.2-RC.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","@aws-sdk/client-dynamodb":"^3.216.0","@aws-sdk/client-ssm":"^3.216.0","@aws-sdk/lib-dynamodb":"^3.216.0","aws-sdk":"^2.1261.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"46d1b76c545ef314e1b9575bf1007774c675b5b2","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.2-RC.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-C4prKCEJvd+5P70OUAsv1TF6jHOQOvyT5S6UAEMpYFaI873mjsTrd1H5iUOBoc2b6E+9/ohmm8V3pRRriB244w==","shasum":"3c47c109402469234d6f3723ef055bcab1722e16","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.2-RC.1.tgz","fileCount":27,"unpackedSize":38446,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCodLtKcp7mgBt+GG7y73ZyvqirtHNYh3Aibn0E5GF4uQIhALsd9ekyKYKriSDdckMzHV78NmoWFz3gvFDlMVkre2T7"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfn+rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoD/A//QLGj3Fz/bETG8lr5/MBh6TUcOK+ncvWIxpQ6lwnxTQumTcmc\r\nQjsATTPznSz8NRUDsn5/T5eT9qkLxHsOSZ8uo1hL+YdMvWQeG0UJa3xHYniX\r\nk7g1CZcRjMNQl1/NK2ZQ7Kf0dwgoQcWuQ23qdPZcicFU6x5xEPthP2BB4xC3\r\nuunydGI0IPhZaEXxfNxmVKBNAyIt2fquZCQXXnrtrL90Ofz/zVuoLMFPO9vj\r\nn/Rr93Bla6x02EJFHqu/vlkxO0bM4JMIIl+pZFWSONF1VHpNlYLSOrYvSYD6\r\nexsID7XbdM4GyC1/zczJNustzMeFGmKfwB3wwItNnR8KDgSDDMLtF10FLeWq\r\nDMZVqmPzTmzxBrrYwMg2iUvmZ35FahXJLbKfXnaWrQZItXBPl8YDS6yWjruJ\r\nq68GCR3eGezI17+R1LgT3JG9TWkttCWwoCYtgy7nIe8HbpbE8CNrzyqptKXR\r\nbBI4EVy/S9alJ89cl4mYOb6lFpg85hfaqbqpjBS3lphJBZtBbVewGLQz32iW\r\nSeFe7aSrDunArAlDRPCJqDASs2SHoTXu503RM6gCaidvjRATs8561tU78GG5\r\nM4KzUFfa1AzLOvy8WSr28HUE/3AbxQ+TqygL1RV7mOJZCiQ3o4lM3FpKscvn\r\nzEVFietuQIxYGhUPpwaYoqPMYJpP1OAFkaE=\r\n=Aj13\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.2-RC.1_1669234602790_0.8736785008556416"},"_hasShrinkwrap":false},"4.0.2-RC.0":{"name":"@begin/data","version":"4.0.2-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","@aws-sdk/client-dynamodb":"^3.216.0","@aws-sdk/client-ssm":"^3.216.0","@aws-sdk/lib-dynamodb":"^3.216.0","aws-sdk":"^2.1261.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"2e91e47a7fdf9d3de085fada6edd400c6c78bfa4","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","_id":"@begin/data@4.0.2-RC.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-pFpVpmnQyA7xOx0pQDbpUMeZTOXzaBT2Z+UiV028b3b4YeLBvPT2PG63LXGoSPFw1ZGNrqKwirigbP05o1IZ+Q==","shasum":"7cb68531aee8c1c6e3c76fb2a9ffaf572b30ce09","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.2-RC.0.tgz","fileCount":27,"unpackedSize":38446,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrA/VH1ih/m1bu0QbUIblRS1rpvCW4KoESOPJBuQAcewIhALfgZn+6wX3mYzqO/5qj1yX8PsetNv/FEyyW3w/npPpI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfn+zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdhxAAjlgjqW8y2PnRMDETfbE9Lv6U9xj4TxMfwXu46ko2yXh/objJ\r\nKzTAl01d5+uFJ2oJ5MPipjP6NujwRvENnpIeaFbcPkmtT1O7n7uPHuKbKto1\r\niEI+L1nDWWO2TYyS0Z442JbmdgLuiJ0WPijrz+8TVH+P61tpikjNp4Wxh/t6\r\nLX/q09v5FljMXXxCaoJNLE7yAcnl8bpmiUs8YfoXpHRnxpkqPLhtBY2bIYuv\r\nKgDNOyGzCoKq7xmaljYnXS8EnFRwPemxzE4h2Q5RjJfmv1C6l3tAuvG8kpE9\r\nxhA/KL+QKoymIq2huMIyE6e3ag0RDC8y9FlpgGgvKxtvyU4eCKz5wi86qCa+\r\n7DdQehn1SeVBdbBC+dBIpLUZNhOv/V3nC29DWeS/ZauCsvgdb2aiz4efgOWw\r\njJqmb08IFBvw2jQtqnM9zlAwxNlJNE39U5Nz+GULvW+dwWq8MhRvC2X54NeK\r\n4bzNOfzndVVRKlLDKEMSbeNWDOeaV7WZNPg8XBwm3FzPKb5GpgukQ4YmAbHD\r\nxljhaMreneki9vO4YchS4L3lM9tXVwCrFc+MEJZuko27f5Pp739ubwvGdg8Q\r\n2JQnnaSt9k/sPLEuaBR2xc0kAK2i7kyVYv/AUFGwf78BSJJpvzCWFCWXfTCc\r\nDP5eXCd8zuzv/JzATvT4Ep+gXuZMmfufmmg=\r\n=V6hV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.2-RC.0_1669234611177_0.7713794487123229"},"_hasShrinkwrap":false},"4.0.2":{"name":"@begin/data","version":"4.0.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.0.1","@architect/sandbox":"^5.1.0-RC.0","@aws-sdk/client-dynamodb":"^3.216.0","@aws-sdk/client-ssm":"^3.216.0","@aws-sdk/lib-dynamodb":"^3.216.0","aws-sdk":"^2.1261.0","eslint":"^8.10.0","tap-spec":"^5.0.0","tape":"^5.5.2","tiny-json-http":"^7.3.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"gitHead":"97cee1409561973b85d82ca64d41cb852895777a","_id":"@begin/data@4.0.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-qMHXC5SY0cRCoewsgKWBzRDS5A6Jgn2yYFKamfCfMgCvPI/wK81Enodgjuv76PoluLqlzma9c9UA33KujsXzMw==","shasum":"e1c211e5452b0f3c935dd4a77d423970a8e58c0e","tarball":"https://registry.npmjs.org/@begin/data/-/data-4.0.2.tgz","fileCount":27,"unpackedSize":38441,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmaycXTbJST4dSMtbe9AgYZ61P/vHL4JgZB9LDgtph7AIgTc9iClexzHDc00Yu6i0rWnE3VS0P7NJms/2LxDzASW8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgSvcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUvw/8CZi1/TREHEJ+bHr7+N4gb/RI5ZGPRE1f3ARxs6ZbWoovcE4B\r\ndeUqVJIhMXoyZZXSBYHom4kNxjKKZW0vgLg7UrmFYojnL0J3X+B+/kWoRjig\r\nlZW8nX3ccpmtlIjVxI1BGjnLyUpUUih8SSCICTkutibJDY/TBrtvRCBknpxB\r\n+1FVifFQNP+1IzCqfGj4YVPsWWoLkKoUe2iCPlDrWrzh4WszjsTIatMLiDor\r\nW6Xb4s8Cjcgvb+6aEJy2d83ESKuLmlbfV3kLZn6O81GGdOym2mANNXighy7z\r\nuoX3gXK8diPWC/7NyyFI8uaJrf0SROtmjW4tEURtZg5bskS6UX6kDgmUzON1\r\n8NXuv06WW1iiI55NdFS0L4SkngsiNA1q8iHMe3wOM7uOf9LvwqGBZ1eVtZ5t\r\ndEBGP3R+mOGfAZmD1y/0Ak/uPVscmvZF0ctwGE5WcDgDeHceZTstHMEBw7yc\r\nmeDWiHvzXaixrSbkXmAKcxlpkV6kzTv6UoLdEhwXLc6QhDlGdsMnRrk228vJ\r\nvfRKMG0NNK6uoYo72qZVvLm8JZIZb/i00nuLYmf6OLD1K0GWkX2WqAh82M8V\r\no9HiBnEWGoVFbubpFkvcwcJc+0qkR1Rw4OPncD+ym1r//kDottq/atslfmyq\r\neGfaz4/wDsSuT5T0/kGNjsMCxSDatHj3F+A=\r\n=DUgC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_4.0.2_1669409756362_0.013259463067166743"},"_hasShrinkwrap":false},"5.0.0-RC.0":{"name":"@begin/data","version":"5.0.0-RC.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.14.3","@aws-lite/dynamodb":"^0.3.3","@aws-lite/ssm":"^0.2.2","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.0-RC.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.0-RC.0","gitHead":"8b29f76062cb1dd8f24281b45f4d956b236b337d","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-QrDinwOPzpXjOXBL6w/wdLwmjJSkJexqmBq/kT+QofGmWqeo0bYGp+RSDUopaOvm1AmtKyTEJCeeePY7r/xtyQ==","shasum":"43dceae195c8a73a0814153c6f18552b73bb57be","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.0-RC.0.tgz","fileCount":25,"unpackedSize":36240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEjSYqkD2zGVPjrxO/2Qt7+CwEY242M3dNGaOLMQgHdVAiEAmj8F/mF1GCxhQZWNe5Y6Ipenqq5ZIevpNUNGxGXB7wM="}]},"_npmUser":{"name":"brianleroux","email":"b@brian.io"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.0-RC.0_1706556102670_0.2784877471183431"},"_hasShrinkwrap":false},"5.0.0-RC.1":{"name":"@begin/data","version":"5.0.0-RC.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.14.3","@aws-lite/dynamodb":"^0.3.3","@aws-lite/ssm":"^0.2.2","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.0-RC.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.0-RC.1","gitHead":"672584a01e2060f40be148ab8e78d5ec5bdc85dd","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-nKxaJJAsgNrZH7elM4al72i5RFI7l5pzDTe/GYEDm0KPb+RvjYpUFvJ3wLSJR81Fgd5p6Lbgt0KcAxmwIh3OzA==","shasum":"39c1df0f22dc559cf0addab802a72bb3a28b384e","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.0-RC.1.tgz","fileCount":25,"unpackedSize":36240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBz0+fNpWqpUv6bW4+IusFxBkfXjHyAxNuHZ63H0DvecAiBm2kOSYA/vi97hETv5Lsrhk344fLsD2baTZo7Nm3y/XA=="}]},"_npmUser":{"name":"brianleroux","email":"b@brian.io"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.0-RC.1_1706573831002_0.4242445834941273"},"_hasShrinkwrap":false},"5.0.0-RC.2":{"name":"@begin/data","version":"5.0.0-RC.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.15.1","@aws-lite/dynamodb":"^0.3.3","@aws-lite/ssm":"^0.2.2","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.0-RC.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.0-RC.2","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md","gitHead":"ee0555731bc700fbdaa09761e59a875504b6bf7e","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-a5z8UZprGxfU57JCiu/exGRESvXwaJjhvmdkBsQ7WhCz7/J5YATzkbK5dNAmm/Nn2p3ouuq9ZCkBwgltZvjMXg==","shasum":"b0c2c6549c12a35a0c75d65142fd87e0d83ce489","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.0-RC.2.tgz","fileCount":25,"unpackedSize":36026,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEcj1kJyGfkvUUGitOFUj8xIA75rHH6Uir5fF4TUl3pAIhAIBz22kGi2aXouBZD5poCNIdQ9I58Pix3LjXwGLqY6B8"}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.0-RC.2_1706584255499_0.6076310231902582"},"_hasShrinkwrap":false},"5.0.0":{"name":"@begin/data","version":"5.0.0","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.15.1","@aws-lite/dynamodb":"^0.3.3","@aws-lite/ssm":"^0.2.2","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.0-RC.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.0","gitHead":"6028b040163755e6ea6060a12a071721b2cee607","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-w8dXKTRd3JGnFRdjqSkiL9SQbWQkAESmnJ+IWkRT8MRqeR0BHOkKvhCBZJmpAp2YWc9G4M6C/R5l5i+ehrGrbw==","shasum":"6f14c45997ee25aee489dc44ff9e82ff529c5de7","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.0.tgz","fileCount":25,"unpackedSize":36021,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHtSGOIqhsrvwHgBGXPhEXgpW737i5GtkBu0Ja3wAfRXAiAHdMAa6To3i0ZChHtiHvZL8sPQEL61o8H/6gJ3gL0JwQ=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.0_1706989935251_0.25637388373047787"},"_hasShrinkwrap":false},"5.0.1":{"name":"@begin/data","version":"5.0.1","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.16.1","@aws-lite/dynamodb":"^0.3.3","@aws-lite/ssm":"^0.2.2","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.1","gitHead":"ca1077e7a6d67762a60c6f7c433796a97e442d5f","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-H14b+pNAbJKdBZow3nUZAfXjAMSAIE2cAd1o1v2jC7iuxUURtSC0LYmWkC9eYQQ/dZVg94Opn4mcVYwd3zkL3w==","shasum":"eb1562cf05a10662f082282f18fd35351308442a","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.1.tgz","fileCount":25,"unpackedSize":36016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDtC8TqMAuUKoFvpRXUkKEWYpkD0R+0gVQ8pV1eXSlcwIhAN6k+e8G+8zfPLbbIEZ9wgsbVhIIq4+HJCObQvvmaQku"}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.1_1707164193911_0.9494388211467728"},"_hasShrinkwrap":false},"5.0.2":{"name":"@begin/data","version":"5.0.2","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.17.1","@aws-lite/dynamodb":"^0.3.4","@aws-lite/ssm":"^0.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.2","gitHead":"06d99a2933989e2eb9330d3ed818e89af39cd56a","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Wa/rB3yyoUL1XCMSAMzXGueWitadsgRo9alO2Q4qzl6528UB+YoqhfrDZLEV09569EJSFdQ+1cYsWelvBLrvKw==","shasum":"c8b7a58eb7f3a96f693e1a4a778986fca3ac6511","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.2.tgz","fileCount":25,"unpackedSize":36335,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6AqRvdZeb0BReJfcBbGl3f15pdXvCwFUj0gH/lYuvwAiBPTTb85Q1KjppNdEIAigekAZx5dNJYCR4LA2mk7wO4yw=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.2_1707406656415_0.23037079936910132"},"_hasShrinkwrap":false},"5.0.3":{"name":"@begin/data","version":"5.0.3","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.17.1","@aws-lite/dynamodb":"^0.3.4","@aws-lite/ssm":"^0.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.3","gitHead":"6d2fe8337abe172dc82773962acf0f55ae87c6ab","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-F+1QeptC5qRda8wI/K4HHhumba+F8G+je2aRa6AtZASAJMk1Tz2SuJ2/IaloheDXTPIuyGhQh4FmD6ssN0ZY7g==","shasum":"0c3bfe71c98112ea9ff0db4a9aae6ff648ac77cc","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.3.tgz","fileCount":25,"unpackedSize":36340,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDu0hfGYcVpW/J/E+18qcAZXiNn6DAOi87FoI9wash0uQIge6En3Z6sLTC6mCClsCIZYMOnUWGmoaC43L5URp/A+EM="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.3_1707439529644_0.8615832621801873"},"_hasShrinkwrap":false},"5.0.4":{"name":"@begin/data","version":"5.0.4","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.21.1","@aws-lite/dynamodb":"^0.3.4","@aws-lite/ssm":"^0.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.4","gitHead":"3d21de399d77986884773ec0bfa06e81c4af7e44","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-LFTKHlhWfMDVWcE4RtvRncs16E6/ADFbBGj9ilC4W4wh87Gw3QZcvLlmFQgo3cOcYhSqG6xXfDuR+n2hP9KL4g==","shasum":"20418be5ade1335a39ed83c49af207d3a53bc59b","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.4.tgz","fileCount":25,"unpackedSize":36340,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdm0AhPJ6zOMkrSyokolr2yJzETZihu+0rK4tFccP01AiEAlS0LzJ7JH30lrKr+1ZTewHigzO4hqL0cuqqwhUq9OyE="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.4_1715110267424_0.003929960317773595"},"_hasShrinkwrap":false},"5.0.5":{"name":"@begin/data","version":"5.0.5","description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","main":"src/index.js","scripts":{"t":"tape test/integration-test.js | tap-spec","lint":"eslint --fix .","test":"npm run lint && tape test/*-test.js | tap-spec","rc":"npm version prerelease --preid RC"},"license":"Apache-2.0","homepage":"https://begin.com","repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"engines":{"node":">=12"},"dependencies":{"@aws-lite/client":"^0.21.5","@aws-lite/dynamodb":"^0.3.4","@aws-lite/ssm":"^0.2.3","@begin/hashid":"^1.0.0","run-parallel":"^1.2.0","run-waterfall":"^1.1.7"},"devDependencies":{"@architect/eslint-config":"^2.1.2","@architect/sandbox":"^6.0.1","eslint":"^8.56.0","tap-spec":"^5.0.0","tape":"^5.7.4","tiny-json-http":"^7.5.1"},"eslintConfig":{"extends":"@architect/eslint-config","rules":{"global-require":"off"}},"keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"_id":"@begin/data@5.0.5","gitHead":"818aaa5b88f19852d126654137bbc235f31a557f","_nodeVersion":"20.13.1","_npmVersion":"10.5.2","dist":{"integrity":"sha512-/OVW944vm6rw7qp9CcVbswzcdXTzVNcVTvn5ajFtAFCE9WwjsvjmhOnyMzEAWkb1eePbB6FmQC9+PX/XjKpI6g==","shasum":"e650e8f75f04f9f21d7258dd870b8ab920e9d334","tarball":"https://registry.npmjs.org/@begin/data/-/data-5.0.5.tgz","fileCount":25,"unpackedSize":36340,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTOwuHJdZIxXngf/P0dpINTkGtOMobhbl7h/karwDHwAiB4B8x1IfdGw1SQnrb/VtsD2b/ixb6v9Q+Q4Kmy1t6lWw=="}]},"_npmUser":{"name":"beginci","email":"support@begin.com"},"directories":{},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/data_5.0.5_1716066273001_0.5572398378845973"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-16T01:15:40.781Z","0.0.1":"2018-09-16T01:15:41.072Z","modified":"2024-05-18T21:04:33.467Z","1.0.0":"2019-01-05T20:35:44.187Z","1.0.1":"2019-01-05T23:15:28.429Z","1.0.2":"2019-01-05T23:46:46.358Z","1.0.3":"2019-01-06T00:27:13.972Z","1.1.0":"2019-01-06T22:09:01.155Z","1.1.1":"2019-01-15T03:57:22.355Z","1.1.2":"2019-09-01T20:57:25.872Z","1.1.4-RC.0":"2019-09-13T00:11:36.533Z","1.1.4":"2019-09-13T22:56:07.065Z","1.1.5-RC.0":"2019-11-12T05:00:02.324Z","1.1.5":"2020-02-02T22:21:18.494Z","1.1.6":"2020-02-05T21:33:04.601Z","1.1.7-RC.0":"2020-02-06T02:55:53.285Z","1.1.7":"2020-02-06T02:59:40.980Z","1.1.8-RC.1":"2020-02-09T22:02:47.405Z","1.1.8-RC.2":"2020-02-11T23:31:31.233Z","1.1.8-RC.3":"2020-02-12T18:42:08.511Z","1.2.0":"2020-02-12T20:08:18.264Z","1.2.1":"2020-04-13T17:34:48.288Z","1.2.2":"2020-04-19T22:54:53.998Z","1.2.3-RC.0":"2020-06-28T04:57:39.189Z","1.2.3":"2020-06-28T05:21:35.124Z","1.2.4-RC.0":"2020-11-12T04:18:53.260Z","2.0.0-RC.0":"2021-02-25T23:46:39.928Z","2.0.0-RC.2":"2021-03-18T20:45:40.028Z","2.0.0":"2021-03-18T21:12:58.611Z","2.0.1":"2021-03-18T23:11:16.400Z","3.0.0":"2021-08-26T16:05:53.457Z","3.0.3":"2021-10-14T17:44:35.125Z","3.0.4":"2021-10-18T20:04:19.669Z","4.0.0-RC.0":"2022-02-07T19:27:27.898Z","4.0.0-RC.1":"2022-02-08T19:16:11.997Z","4.0.0-RC.2":"2022-03-01T03:40:48.441Z","4.0.0":"2022-03-10T23:07:54.780Z","4.0.1-RC.0":"2022-09-22T16:17:39.767Z","4.0.1":"2022-09-22T19:10:21.150Z","4.0.2-RC.1":"2022-11-23T20:16:42.969Z","4.0.2-RC.0":"2022-11-23T20:16:51.330Z","4.0.2":"2022-11-25T20:55:56.530Z","5.0.0-RC.0":"2024-01-29T19:21:42.827Z","5.0.0-RC.1":"2024-01-30T00:17:11.208Z","5.0.0-RC.2":"2024-01-30T03:10:55.642Z","5.0.0":"2024-02-03T19:52:15.409Z","5.0.1":"2024-02-05T20:16:34.072Z","5.0.2":"2024-02-08T15:37:36.562Z","5.0.3":"2024-02-09T00:45:29.917Z","5.0.4":"2024-05-07T19:31:07.578Z","5.0.5":"2024-05-18T21:04:33.239Z"},"maintainers":[{"name":"ryanblock","email":"rblock+npm@gmail.com"},{"name":"dam","email":"kristoferjoseph@gmail.com"},{"name":"brianleroux","email":"b@brian.io"},{"name":"beginci","email":"support@begin.com"}],"description":"Begin Data is a durable and fast key/value document store built on top of DynamoDB","homepage":"https://begin.com","keywords":["serverless","database","AWS","dynamodb","keyvalue","infrastructure","infra"],"repository":{"type":"git","url":"git+https://github.com/beginner-corp/begin-data.git"},"bugs":{"url":"https://github.com/beginner-corp/begin-issues/issues"},"license":"Apache-2.0","readme":"# Begin Data\n## [`@begin/data`](https://www.npmjs.com/package/@begin/data)\n\n[![GitHub CI status](https://github.com/smallwins/begin-data/workflows/Node%20CI/badge.svg)](https://github.com/smallwins/begin-data/actions?query=workflow%3A%22Node+CI%22)\n\nBegin Data is an easy to use, fast, and durable key/value and document store built on top of DynamoDB. Originally built for [Begin serverless apps](https://begin.com), Begin Data’s core API has three simple methods: `get`, `set`, and `destroy`.\n\n## Concepts\n\nBegin Data organizes itself into `table`s. A `table` contain documents which are just collections of plain Objects. Documents stored in Begin Data always have the properties `table` and `key`.\n\nOptionally a document can also have a `ttl` property with a UNIX epoch value representing the expiry time for the document.\n\n## Usage\n\nBegin Data operates on one DynamoDB table named `data` with a partition key `scopeID` and a sort key of `dataID` (and, optionally, a `ttl` for expiring documents).\n\nExample `app.arc`:\n\n```\n@app\nmyapp\n\n@tables\ndata\n  scopeID *String\n  dataID **String\n  ttl TTL\n```\n\nOr equivalent CloudFormation YAML:\n\n```yaml\nAWSTemplateFormatVersion: \"2010-09-09\"\nResources:\n    BeginData:\n        Type: \"AWS::DynamoDB::Table\"\n        Properties:\n            TableName: \"data\"\n            BillingMode: \"PAY_PER_REQUEST\"\n            KeySchema:\n              -\n                AttributeName: \"scopeID\"\n                KeyType: \"HASH\"\n              -\n                AttributeName: \"dataID\"\n                KeyType: \"RANGE\"\n            SSESpecification:\n                Enabled: \"false\"\n            TimeToLiveSpecification:\n                AttributeName: \"ttl\"\n                Enabled: \"TRUE\"\n```\n\n> Note: projects not based on [Architect](https://arc.codes) will need a `BEGIN_DATA_TABLE_NAME` environment variable. You can also use this env var to override and name the table anything you want. This also allows for multiple apps to share a single table.\n\n### API\n\n```javascript\nlet data = require('@begin/data')\n```\n\nThe core API is three methods:\n\n- `data.get(params[, callback])` → `[Promise]` for retreiving data\n- `data.set(params[, callback])` → `[Promise]` for writing data\n- `data.destroy(params[, callback])` → `[Promise]` for removing data\n\nAdditional helper methods are also made available:\n\n- `data.incr(params[, callback])` → `[Promise]` increment an attribute on a document\n- `data.decr(params[, callback])` → `[Promise]` decrement an attribute on a document\n- `data.count(params[, callback])` → `[Promise]` get the number of documents for a given table\n\nAll methods accept a params object and, optionally, a Node-style errback. If no errback is supplied, a Promise is returned. All methods support `async`/`await`.\n\n#### Writes\n\nSave a document in a `table` by `key`. Remember: `table` is required; `key` is optional.\n\n```javascript\nlet taco = await data.set({\n  table: 'tacos',\n  key: 'al-pastor'\n})\n```\n\nAll documents have a `key`. If no `key` is given, `set` will generate a unique `key`.\n\n```javascript\nlet token = await data.set({\n  table: 'tokens',\n})\n// {table:'tokens', key:'LCJkYX9jYWwidW50RhSU'}\n```\n\nBatch save multiple documents at once by passing an Array of Objects.\n\n```javascript\nlet collection = await data.set([\n  {table: 'ppl', name:'brian', email:'b@brian.io'},\n  {table: 'ppl', name:'sutr0', email:'sutr0@brian.io'},\n  {table: 'tacos', key:'pollo'},\n  {table: 'tacos', key:'carnitas'},\n])\n```\n\n#### Reads\n\nRead a document by `key`:\n\n```javascript\nlet yum = await data.get({\n  table: 'tacos',\n  key: 'baja'\n})\n```\n\nBatch read by passing an Array of Objects. With these building blocks you can construct secondary indexes and joins, like one-to-many and many-to-many.\n\n```javascript\nawait data.get([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n#### Destroy\n\nDelete a document by `key`.\n\n```javascript\nawait data.destroy({\n  table: 'tacos',\n  key: 'pollo'\n})\n```\n\nBatch delete documents by passing an Array of Objects.\n\n```javascript\nawait data.destroy([\n  {table:'tacos', key:'carnitas'},\n  {table:'tacos', key:'al-pastor'},\n])\n```\n\n## Pagination\n\nLarge sets of data can not be retrieved in one call because the underlying `get` api paginates results.\nIn this case use the `for await` syntax with a limit set to get paginated data.\n\n```javascript\nlet pages = data.page({ table:'ppl', limit:25 })\nlet count = 0  \nfor await (let page of pages) {\n  console.log(page)\n  count++\n}\n```\n\n## Additional Superpowers\n\n- Documents can be expired by setting `ttl` to an UNIX epoch in the future.\n- Atomic counters: `data.incr` and `data.decr`\n\nSee the tests for more examples!\n\n## Patterns\n\nComing soon! Detailed guides for various data persistence tasks:\n\n- Denormalizing\n- Pagination\n- Counters\n- Secondary indexes\n- One to many\n- Many to many\n\n## More\n\n- [Try out Begin Data on Begin!](https://begin.com)\n- [Learn more about Begin Data](https://docs.begin.com/en/data/begin-data/)\n","readmeFilename":"readme.md"}