{"id":16416614,"url":"https://github.com/angeal185/tweekdb","last_synced_at":"2026-05-08T09:32:32.681Z","repository":{"id":57382579,"uuid":"267272127","full_name":"angeal185/tweekdb","owner":"angeal185","description":"The flat-file, in-memory, remote-sync or hybrid db that is as lightning fast as you configure it to be.","archived":false,"fork":false,"pushed_at":"2020-06-09T02:20:54.000Z","size":169,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T02:51:15.990Z","etag":null,"topics":["cache-storage","database","db","encrypted-store","flat-file-db","flat-file-storage","hybrid-database","in-memory-database","in-memory-storage","json","json-database","json-db","lodash","nosql-database"],"latest_commit_sha":null,"homepage":"https://runkit.com/angeal185/tweekdb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angeal185.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-27T09:06:54.000Z","updated_at":"2023-12-05T06:41:54.000Z","dependencies_parsed_at":"2022-09-01T04:02:05.205Z","dependency_job_id":null,"html_url":"https://github.com/angeal185/tweekdb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/angeal185/tweekdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Ftweekdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Ftweekdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Ftweekdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Ftweekdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angeal185","download_url":"https://codeload.github.com/angeal185/tweekdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angeal185%2Ftweekdb/sbom","scorecard":{"id":195764,"data":{"date":"2025-08-11","repo":{"name":"github.com/angeal185/tweekdb","commit":"523e6ac8e1c0d6487db4128de9088a8750b060de"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T21:47:52.059Z","repository_id":57382579,"created_at":"2025-08-16T21:47:52.059Z","updated_at":"2025-08-16T21:47:52.059Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32774784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache-storage","database","db","encrypted-store","flat-file-db","flat-file-storage","hybrid-database","in-memory-database","in-memory-storage","json","json-database","json-db","lodash","nosql-database"],"created_at":"2024-10-11T07:09:41.002Z","updated_at":"2026-05-08T09:32:32.659Z","avatar_url":"https://github.com/angeal185.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# tweekdb\nThe flat-file, in-memory, remote-sync or hybrid db that is as lightning fast as you configure it to be.\n\n![cd-img] ![dep-img] ![syn-img] ![sz-img]\n\n[![NPM Version][npm-img]][npm-url] ![lic-img]\n\n#### [Live playground](https://runkit.com/angeal185/tweekdb)\n\n## Installation\n\nnpm\n\n```sh\n$ npm install tweekdb --save\n```\n\ngit\n```sh\n$ git clone https://github.com/angeal185/tweekdb.git\n```\n\n## setup\n\n```js\n\nconst { tweek, tweekdb } = require('tweekdb');\n\n\n//minimal base setup example\nconst db = tweek(new tweekdb('./db'));\n\n//minimal cache only setup example\nconst db = tweek(new tweekdb());\n\n//complete custom base setup example\nconst db = tweek(new tweekdb('./db',{\n  //add custom db serialize function\n  serialize: function(data){\n    return Buffer.from(JSON.stringify(data), 'utf8').toString('base64')\n  },\n  //add custom db deserialize function\n  deserialize: function(data){\n    return JSON.parse(Buffer.from(data, 'base64').toString())\n  },\n  //default db schema ~ overrides config file settings\n  schema: {\n    array: [],\n    object:{},\n    key: 'value'\n  },\n  //custom cron job entry point\n  cron: function(current_db_state){\n    console.log(JSON.stringify(current_db_state))\n  },\n  //enable db encryption ~ overrides config file settings\n  encryption: false,\n  //enable db backup ~ overrides config file settings\n  backup: false,\n  //enable db gzip ~ overrides config file settings\n  gzip: false,\n  //remote db fetch settings ~ overrides config file settings\n  fetch_config: {\n    hostname: \"\",\n    port: 443,\n    path: \"\",\n    method: \"GET\",\n    headers:{}\n  },\n  //remote db sync settings ~ overrides config file settings\n  sync_config {\n    hostname: \"\",\n    port: 443,\n    path: \"\",\n    method: \"POST\",\n    headers:{}\n  },\n}));\n\n\n//multiple db can be created with different configurations like so:\n\nconst db1 = tweek(new tweekdb('./db1',{\n  backup: false,\n  encryption: false,\n  gzip: true\n}));\n\nconst db2 = tweek(new tweekdb('./db2',{\n  backup: true,\n  encryption: true,\n  gzip: false,\n  schema: {\n    array: []\n  }\n}));\n\n\n//create config file in cwd\ndb.clone_config();\n```\n\n## config\n\n```js\n{\n  \"settings\": {\n    \"verbose\": true, //log to console\n    \"dev\": true,  //development mode\n    \"lodash_path\": \"lodash\", //require path to lodash or custom lodash\n    \"noconflict\": false, // fixes lodash conflict issues at a cost\n    \"crypto_utils\": true // enable extra crypto utils\n  },\n  \"backup\": { //db backup config\n    \"enabled\": false,\n    \"ext\": \"tmp\", //db backup file extention\n    \"pre\": \".\" //db backup file prefix\n  },\n  \"turbo\": { // turbo mode config\n    \"enabled\": true,\n    \"ms\": 5 // debounce delay in milliseconds\n  },\n  \"cron\": { // cronjobs config\n    \"enabled\": false,\n    \"ms\": 10000 // cron task interval in milliseconds\n  },\n  \"fetch\": { // remote db fetch config\n    \"enabled\": true,\n    \"config\": { // accepts all nodejs https config options\n      \"hostname\": \"\",\n      \"port\": 443,\n      \"path\": \"\",\n      \"method\": \"GET\",\n      \"headers\":{}\n      // optional key/cert/pfx as path relative to cwd() ~ ./demo.cert\n    }\n  },\n  \"sync\": {// remote db save config\n    \"enabled\": false,\n    \"config\": { // accepts all nodejs https config options\n      \"hostname\": \"\",\n      \"port\": 443,\n      \"path\": \"\",\n      \"method\": \"POST\",\n      \"headers\":{}\n      // optional key/cert/pfx as path relative to cwd() ~ ./demo.pfx\n    }\n  },\n  \"gzip\":{ // db gzip config\n    \"enabled\": false, // gzip db\n    \"backup\": true, // gzip db backup\n    \"settings\":{\n      \"level\": 9,\n      \"memLevel\": 9,\n      \"strategy\": 0\n    }\n  },\n  \"hmac\": {\n    \"secret\": \"\", // hmac secret (encoded with hmac.encode)\n    \"encode\": \"hex\", // hmac/hash encoding\n    \"digest\": \"sha512\" // hmac/hash digest sha256/sha384/sha512\n                       //sha3-256/sha3-384/sha3-512\n  },\n  \"encryption\":{\n    \"enabled\": false,\n    \"secret\": \"\", // encryption secret (encoded with encryption.settings.encode)\n    \"secret_len\": 32, // secret length 16/24/32\n    \"iterations\": 60000, // pbkdf2 iterations\n    \"settings\": {\n      \"cipher\": \"aes\", // encryption cipher aes/camellia/aria\n      \"bit_len\": \"256\", // 128/192/256\n      \"iv_len\": 32, // encryption iv length\n      \"tag_len\": 16,  // encryption tag length\n      \"encode\": \"hex\", // encryption encoding\n      \"mode\": \"gcm\", // gcm/cbc/ccm/ctr/cfb/cfb1/cfb8/ocb/ofb\n      \"digest\": \"sha512\" // keygen digest sha256/sha384/sha512\n                         //sha3-256/sha3-384/sha3-512 ...\n    }\n  },\n  \"static\":{ //db static file generator options\n    \"enabled\": true,\n    \"dest\": \"./\" //static file dest\n  },\n  \"schema\": {} //default db schema\n}\n\n```\n\n## config file\n  the tweekdb config file can be generated by calling `db.clone_config()` and will create a `tweekdb.json` in your working directory. without this config file, settings will fall back to their defaults. this file is key to optimizing your db. should you have more than one db using the same config file, certain overrides can be set when calling `new tweekdb('./db', overrides)`. by default the config file is set for speed optimization with most features disabled.\n\n## backup mode\n  the `config.backup` setting will enable db backups  on save() and load from the backup file in the unlikely event of data corruption to the db. this setting can be used in conjunction with `config.gzip` to compress your backups. if you are using a large sized db `config.turbo` is recommended. db backups can also be called manually. this method is non blocking.\n\n## turbo mode\n  the `config.turbo` setting will debounce file writes in a non blocking way within the time-frame that you specify. for example, if you set  `config.turbo.ms` to 100, all calls to .save() will have .val() stored to cache but the file write will be debounced for 100ms. if another call to .save() is detected within 100ms, the timeframe is reset and write is debounced again. out of all the consecutive writes you receive within 100ms of each other, only the last write will be written. this process is non blocking and will return/callback to the user at the point of .val() being updated. the speed gains of this feature should theoretically grow with the size of your db.\n\n## encryption\n  tweekdb supports encryption out of the box and can be configured at `config.encryption`. prior to enabling this feature an appropriately sized encryption key must be generated with the appropriate encoding. this can be created and returned by calling `db.keygen()`. this method is non blocking when used in conjunction with `config.turbo`.\n\n## gzip\n  the `config.gzip` setting will enable db compression should you wish to compress your db and or backup. if you are using a large sized db `config.turbo` is recommended. this method is non blocking when used in conjunction with `config.turbo`.\n\n## cron\n  the `config.cron` setting will enable you to set a recurring cron job to be carried out at the inteval in milliseconds you specify at `config.cron.ms`. the cron function has one arg which the current state of the db. an example function can be found in the settings section.\n\n## serialize/deserialize\n  by default, tweekdb will serialize/deserialize valid json. this can be customized via the serialize/deserialize functions so that tweekdb will serialize/deserialize from and to any format and or encoding.\n  for example:\n\n```js\n\n  // store db as json pretty\n  const db = tweek(new tweekdb('./db.json',{\n    serialize: function(data){\n      return JSON.stringify(data,0,2)\n    }\n  }));\n\n  // store db as byte array\n  const db = tweek(new tweekdb('./db',{\n    deserialize: function(data){\n      return JSON.parse(Buffer.from(JSON.parse(data)).toString())\n    },\n    serialize: function(data){\n      return JSON.stringify(Array.from(Buffer.from(JSON.stringify(data))))\n    }\n  }));\n\n  // store db hex encoded\n  const db = tweek(new tweekdb('./db',{\n    serialize: function(data){\n      return Buffer.from(JSON.stringify(data), 'utf8').toString('hex')\n    },\n    deserialize: function(data){\n      return JSON.parse(Buffer.from(data, 'hex').toString())\n    }\n  }))\n\n```\n\n## lodash\n  tweekdb is built using lodash. should you wish, you can create your own filtered lodash module and update the require() path at `config.settings.lodash_path`.\n\n  tweekdb uses all the same chain-able methods as lodash. be mindful that many of these methods will mutate your items in place while others will return a new item.\n\nfor example:\n```js\n{\n  \"array\": [1,2,3,4,5]\n}\n\n// remove value 2 from the array and mutates the array.\n// this action will update the db cache\ndb.get('array').pull(2).val()\nconsole.log(db.get('array').val()) // [1,3,4,5]\n\n// remove value 2 from the array but returns a new array\n// this action will not update the db cache but will return\n// a new array without 2\nlet x = db.get('array').without(2).val()\n\nconsole.log(db.get('array').val()) // [1,2,3,4,5]\nconsole.log(x) // [1,3,4,5]\ndb.set('array',x).val()\nconsole.log(db.get('array').val()) // [1,3,4,5]\n```\n\n\n## examples\n```js\n\n// db.load/db.fetch/db.cache will store your db to cache and should only be called once.\n\n// db load from file to cache sync\ndb.load();\n\n//db load from file to cache  async\ndb.load(function(err, data){\n  if(err){return console.error(err)};\n  // db. in now available outside of this scope\n  console.log(data.val())\n});\n\n//load remode db to cache using the settings in your config file\ndb.fetch(function(err,data){\n  if(err){return console.error(err)}\n  // db. in now available outside of this scope\n  console.log(data.val())\n})\n\n//manually set db cache from any source\ndb.cache({\n  test: \"scema\"\n})\n\n// calling .save() will update cache state as well as write state to file.\n// calling .val() will update only the cache state.\n\n//save cached db state to file sync\ndb.save();\n\n//save cached db state to async\ndb.save(function(err){\n  if(err){return console.error(err)};\n});\n\n//save a remode db using the settings in your config file\ndb.sync(function(err){\n  if(err){return console.error(err)}\n  console.log('done')\n})\n\n// add defaults to base db schema and save state to cache.\ndb.defaults({\n  collection:[{\"test\":\"ok\"}],\n  array:[],\n  key: 'val'\n}).val()\n\n// add defaults to base db schema and save state to db file.\ndb.defaults({\n  collection:[{\"test\":\"ok\"}],\n  array:[1,2,3,4,5],\n  key: 'val'\n}).save()\n\n\n// create a key val pair and save state to cache.\ndb.set('key', 'value').val();\n\n// create an array named array and save state to cache.\ndb.set('array', []).val();\n\n// create a collection named collection\ndb.set('collection', [{test:'working'}]).val();\n\n// create object and save state to cache\ndb.set('obj', {test:'working'}).val()\n\n// append an object to a collection\ndb.get('collection').push({ id: db.uuid()}).val()\n\n// append a value then prepend a value to an array\ndb.get('array').push(1).unshift(2).val()\n\n// prepend an object to a collection\ndb.get('collection').unshift({ id: db.uuid()}).val()\n\n// prepend a value and append a value to an array\ndb.get('collection').unshift({ id: db.uuid()}).push({ id: db.uuid()}).val()\n\n// remove an object from a collection and add a new object\ndb.get('collection').remove({\"test\":\"working\"}).push({\"test\":\"working2\"}).val()\n\n// remove a value from an array and append a new value\ndb.get('array').pull('test').unshift('test2').val()\n\n// find an object in a collection\nconsole.log(\n  db.get('collection').find({\"test\":\"working\"}).val()\n) // {test:'working'}\n\n// find index of an object in a collection\nconsole.log(\n  db.get('collection').findIndex({\"test\":\"working\"}).val()\n) // 0\n\n\n// return first item in a collection or array\nconsole.log(\n  db.get('array').head().val()\n) // 1\n\n// return first item in a collection or array\nconsole.log(\n  db.get('array').tail().val()\n) // 5\n\n// return last item in a collection or array\nconsole.log(\n  db.get('collection').head().val()\n) // {test:'working'}\n\n```\n\n\n## static method\n\ntweekdb can also be used as a dev tool to generate json files by calling `.static('filename')`\nfrom your db items.\n\n```js\n\ndb.set('blog_posts', [{\n    id: 1,\n    title: \"post 1\",\n    author: \"x\",\n  },{\n    id: 2,\n    title: \"post 2\",\n    author: \"x\"\n  },{\n    id: 3,\n    title: \"post 3\",\n    author: \"x\"\n  },{\n    id: 4,\n    title: \"post 4\",\n    author: \"x\"\n  },{\n    id: 5,\n    title: \"post 5\",\n    author: \"x\"\n  }]\n)\n\n// create a json file for each post in the config.static.dest folder\nlet x = db.get('blog_posts').val();\nfor (let i = 0; i \u003c x.length; i++) {\n  db.get('blog_posts['+ i +']').static('post_'+ x[i].id)\n}\n\n```\n\n\n## utils\n\n`config.settings.crypto_utils` will add the following utils to the build.\n\n```js\n\n//create config file in cwd\ndb.clone_config();\n\n//create new cryptographically secure secret\ndb.keygen();\n\n//generate uuidv4\ndb.uuid();\n\n\n/**\n *  encrypt a string\n *  @param {string} data ~ data to be encrypted\n *  @param {string} secret ~ optional / fallback to config file\n **/\n\n db.encrypt(data,secret);\n\n /**\n  *  decrypt a string\n  *  @param {string} data ~ data to be encrypted\n  *  @param {string} secret ~ optional / fallback to config file\n  **/\n\n  db.decrypt(data,secret);\n\n/**\n *  hmac a string\n *  @param {string} data ~ data for hmac\n *  @param {string} secret ~ optional / fallback to config file\n **/\n\n db.hmac(data,secret)\n\n/**\n  *  hash a string\n  *  @param {string} data ~ data for hash\n  **/\n\n  db.hash(data);\n\n/**\n *  random bytes\n *  @param {integer} len ~ length\n *  @param {string} encode ~ hex/base64 ...\n **/\n\n db.rnd(len,encode)\n\n```\n\n## mixins\n\nyou can create your own custom chain-able methods using `db._.mixin()`;\n\n```js\n\n// mixin to replace an object within a collection\n\ndb._.mixin({\n  replaceRecord: function(arr, current_object, new_object) {\n    return arr.splice( _.findIndex(arr, current_object), 1, new_object)\n  }\n})\n\n// use mixin like so.\n\ndb.get('collection').replaceRecord({\"test\":\"working\"}, {\"test\":\"working2\"}).val();\n\n```\n\n[cd-img]: https://app.codacy.com/project/badge/Grade/526610b860784ec08094f0c0b1b8f907\n[npm-img]: https://badgen.net/npm/v/tweekdb?style=flat-square\n[dep-img]:https://badgen.net/david/dep/angeal185/tweekdb?style=flat-square\n[sz-img]:https://badgen.net/packagephobia/publish/tweekdb?style=flat-square\n[lic-img]: https://badgen.net/npm/license/tweekdb?style=flat-square\n[syn-img]: https://snyk.io.cnpmjs.org/test/npm/tweekdb\n[npm-url]: https://npmjs.org/package/tweekdb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeal185%2Ftweekdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangeal185%2Ftweekdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeal185%2Ftweekdb/lists"}