{"id":44602615,"url":"https://github.com/hurlatunde/swallowstore","last_synced_at":"2026-02-14T10:02:18.558Z","repository":{"id":33242195,"uuid":"156443365","full_name":"hurlatunde/swallowstore","owner":"hurlatunde","description":"A flexible easy to use Google Cloud Firestore API Wrapper class for Node.JS","archived":false,"fork":false,"pushed_at":"2023-01-09T11:26:01.000Z","size":246,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-27T18:33:42.615Z","etag":null,"topics":["cloud","firebase","firebase-database","firestore","google-cloud","google-cloud-firestore-api-wrapper"],"latest_commit_sha":null,"homepage":"","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/hurlatunde.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":"2018-11-06T20:28:13.000Z","updated_at":"2019-11-05T15:47:03.000Z","dependencies_parsed_at":"2023-01-15T00:03:59.704Z","dependency_job_id":null,"html_url":"https://github.com/hurlatunde/swallowstore","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/hurlatunde/swallowstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hurlatunde%2Fswallowstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hurlatunde%2Fswallowstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hurlatunde%2Fswallowstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hurlatunde%2Fswallowstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hurlatunde","download_url":"https://codeload.github.com/hurlatunde/swallowstore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hurlatunde%2Fswallowstore/sbom","scorecard":{"id":473803,"data":{"date":"2025-08-11","repo":{"name":"github.com/hurlatunde/swallowstore","commit":"5c36ed0ff0937f22d56d60a0106e44636e819c2f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/22 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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"43 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fpm5-vv97-jfwg","Warn: Project is vulnerable to: GHSA-4g6q-77j7-vvjc","Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9","Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-v9mx-4pqq-h232","Warn: Project is vulnerable to: GHSA-4j66-8f4r-3pjx","Warn: Project is vulnerable to: GHSA-r92x-f52r-x54g","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-3wf4-68gx-mph8","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-wgfq-7857-4jcc","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T14:42:15.742Z","repository_id":33242195,"created_at":"2025-08-19T14:42:15.742Z","updated_at":"2025-08-19T14:42:15.742Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29442326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: 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":["cloud","firebase","firebase-database","firestore","google-cloud","google-cloud-firestore-api-wrapper"],"created_at":"2026-02-14T10:00:46.814Z","updated_at":"2026-02-14T10:02:18.553Z","avatar_url":"https://github.com/hurlatunde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Swallowstore\n=========\n\n[![npm version](https://badge.fury.io/js/swallowstore.svg)](https://badge.fury.io/js/swallowstore)\n[![NPM](https://nodei.co/npm/swallowstore.png?mini=true)](https://nodei.co/npm/swallowstore/)\n[![GitHub file size](https://img.shields.io/github/size/webcaetano/craft/build/phaser-craft.min.js.svg)](https://github.com/hurlatunde/swallowstore)\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/hurlatunde/swallowstore)\n[![GitHub](https://david-dm.org/hurlatunde/swallowstore.svg)](https://github.com/hurlatunde/swallowstore)\n\n\nA flexible easy to use Google Cloud Firestore API Wrapper class for Node.JS\n\n## Installation\n\n  `npm install swallowstore`\n  \n  \n  ```javascript\nimport * as swallowInstance from \"swallowstore\";\n```\n  \n  \n## Sample Usage\n  ```javascript\n  const swallowInstance = require('swallowstore');\n  \n  //swallowstore initialize with firestore config\n  swallowInstance.initialize({\n      databaseURL: \"https://my-first-project.com\",\n      projectId: \"my-first-project\",\n  })\n\n  // Get all users\n  swallowInstance.findAll('users').then(response =\u003e {\n    console.log(response);\n  });\n  ```\n  Available Methods: *findById(), findOne(), findAll(), saveAndUpdate(), paginator(), delete()*\n\n\n# API Reference\n\n##### `.initialize(firebaseConfig: object)`\n\nSet collection firebase Config.\n\n**Parameters:**\n- `object` firebase config setting\n\n  ```javascript  \n  //swallowstore initialize with firestore config\n  swallowInstance.initialize({\n      databaseURL: \"https://my-first-project.com\",\n      projectId: \"my-first-project\",\n  })\n  ```\n  \n##### `.findById(collectionName: string, id: string ): Promise\u003cDocument[]\u003e`\n\nGet One document in a collection by ID.\n\n**Parameters:**\n- `id` The document ID /  `ids` The document IDs\n\n**Returns:**\n- A `Document` object or `null`\n\n**Sample Code:**\n```javascript\n// Get user by id \nswallowInstance.findById('users', '5ixWj00cZYDirdz9CCJd').then(response =\u003e {\n    console.log(\"users with id '5ixWj00cZYDirdz9CCJd' detail:\", response);\n});\n\n// Get user by ids\nswallowInstance.findById('users', ['0Qq4GEfXPsc2ixvDZv8MFEcu2ek1', '0Qq4GEfXPsc2ixvDZv8MFEcu2ek1']).then(response =\u003e {\n    console.log(\"users with ids '['0Qq4GEfXPsc2ixvDZv8MFEcu2ek1', '0Qq4GEfXPsc2ixvDZv8MFEcu2ek1']' detail:\", response);\n});\n```\n\n  \n##### `.findOne(collectionName: string, { conditions: Array\u003cCondition\u003e = null } ): Promise\u003cDocument[]\u003e`\n\nGet One document in a collection by ID or by conditions.\n\n**Parameters:**\n- `conditions` Array of conditions\n- `id` The document ID\n\n**Returns:**\n- A `Document` object or `null`\n\n**Sample Code:**\n```javascript\n\n// Get user by id\nswallowInstance.findOne('users', { id: '5ixWj00cZYDirdz9CCJd' }).then(response =\u003e {\n    console.log(\"users with id '5ixWj00cZYDirdz9CCJd' detail:\", response);\n});\n\n// Get user by condition(s)\nconst conditions = {\n    'where': [\n        ['email', '==', 'hurlatunde@gmail.com']\n        ['password', '==', 'password']\n    ]\n};\n\nswallowInstance.findOne('users', conditions).then(response =\u003e {\n    console.log(\"user:\", response);\n});\n```\n\n\n##### `.saveAndUpdate(collectionName: string, data: Object, id: String ): Promise\u003cResultData\u003e`\n\nAdd / Update a document.\n\n**Parameters:**\n- `data` A document object\n- `id` The document ID\n\n**Returns:**\n- `ResultData` object or `null`\n\n**Sample Code:**\n```javascript\n// Add a user with auto-generated ID\nconst userObject = {\n    name: 'Kat',\n    email: 'kat@email.com',\n    gender: 'female'\n};\n\nswallowInstance.saveAndUpdate('users', userObject).then(response =\u003e {\n    console.log(\"Add Result (auto-generated ID):\", response);\n});\n// response { node_id: 'BQFNY9pQDhZOarvmoMSB' }\n\n// Add a user with custom ID\nconst userObject = {\n    node_id: 'BQFNY9pQDhZOarvmoMSB',\n    name: 'Gary',\n    email: 'gary@email.com',\n    gender: 'male'\n};\n\nswallowInstance.saveAndUpdate('users', userObject).then(response =\u003e {\n    console.log(\"Add Result (custom ID):\", response);\n});\n// response { node_id: 'BQFNY9pQDhZOarvmoMSB' }\n\n\n// Update a user with ID\nswallowInstance.saveAndUpdate('users', userObject, 'BQFNY9pQDhZOarvmoMSB').then(response =\u003e {\n    console.log(\"Updated Result:\", response);\n});\n// response { node_id: 'BQFNY9pQDhZOarvmoMSB' }\n\n```\n\n\n##### `.findAll(collectionName: string, { conditions: Array\u003cCondition\u003e = null, orderBy: Array\u003cOrderBy\u003e = null, limit: number = null } ): Promise\u003cDocument[]\u003e`\n\nGet document in a collection.\n\n**Parameters:**\n- `conditions` Array of conditions\n- `orderBy` Field name to order by\n- `limit` Number of documents to retrieve || default is 20\n\n**Returns:**\n- Array of `Document` object\n\n**Sample Code:**\n```javascript\n\n// Get all users\nswallowInstance.findAll('users').then(response =\u003e {\n    console.log(\"All users: \", response);\n});\n\n// Get all users by condition(s)\nconst conditions = {\n    'where': [\n        ['age', '\u003e=', 20]\n        ['likes', '\u003e=', 200]\n    ],\n    'limit': 5\n};\n\nswallowInstance.findAll('users', conditions).then(response =\u003e {\n    console.log(\"All users with age \u003e= '20' \u0026 likes \u003e= '200', limit '5':\", response);\n});\n```\n\n##### `.paginator(collectionName: string): paginatorDocument{}`\n\nGet paginate document in a collection.\n\n**Parameters:**\n- `conditions` Array of conditions\n- `orderBy` Field name to order by\n- `limit` Number of documents to retrieve || default is 20\n\n**Returns:**\n- Array of `Document` object\n\n**Sample Code:**\n```javascript\n\n// Get all users\nlet paginateInit;\npaginateInit = swallowInstance.paginator('users');\npaginateInit.params({'limit': 2, 'orderBy': 'full_name'}).then(({data}) =\u003e {\n    console.log(data);\n});\n    \n// Get the next index of user collection by condition(s)\npaginateInit.next().then(({data}) =\u003e {\n    console.log(\"next users collection: \",data);\n});\n\n// Get the previous index of user collection by condition(s)\npaginateInit.previous().then(({data}) =\u003e {\n    console.log(\"previous users collection: \",data);\n});\n```\n\n##### `delete(collectionName: string, id: string): Promise\u003cResultData\u003e`\n\nDelete a document\n\n**Parameters:**\n- `id` The document ID\n\n**Returns:**\n- `ResultData` object or `null`\n\n**Sample Code:**\n```javascript\n// Delete a user by ID\nswallowInstance.delete('users', {'id' : 'HnjIzeysNmi4DLL2tFUJ'}).then((res) =\u003e {\n    console.log(\"Delete Result:\", result);\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhurlatunde%2Fswallowstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhurlatunde%2Fswallowstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhurlatunde%2Fswallowstore/lists"}