{"id":21131291,"url":"https://github.com/jrop/nedb-promise","last_synced_at":"2025-07-09T01:33:43.589Z","repository":{"id":36322881,"uuid":"40627555","full_name":"jrop/nedb-promise","owner":"jrop","description":"Promisified nedb wrapper","archived":false,"fork":false,"pushed_at":"2018-12-03T05:24:11.000Z","size":20,"stargazers_count":96,"open_issues_count":4,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T03:37:42.152Z","etag":null,"topics":["javascript","nedb","nodejs","promise","promise-api","promise-wrapper","promisified-methods"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nedb-promise","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-12T22:36:54.000Z","updated_at":"2024-05-19T11:30:58.000Z","dependencies_parsed_at":"2022-09-08T02:26:12.629Z","dependency_job_id":null,"html_url":"https://github.com/jrop/nedb-promise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jrop/nedb-promise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Fnedb-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Fnedb-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Fnedb-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Fnedb-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrop","download_url":"https://codeload.github.com/jrop/nedb-promise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Fnedb-promise/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375611,"owners_count":23598414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["javascript","nedb","nodejs","promise","promise-api","promise-wrapper","promisified-methods"],"created_at":"2024-11-20T05:53:16.537Z","updated_at":"2025-07-09T01:33:43.255Z","avatar_url":"https://github.com/jrop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"nedb-promise\n============\n\nA promise wrapper for [NeDB](https://github.com/louischatriot/nedb).\n\nInstallation\n============\n\nInstall with NPM:\n\n`$ npm i --save nedb-promise`\n\nUsage\n=====\n\nExample using ES7 async/await:\n```javascript\nimport datastore from 'nedb-promise'\n\nasync function doDatabaseStuff() {\n  let DB = datastore({\n     // these options are passed through to nedb.Datastore\n\n     filename: 'my-db.json',\n\n     autoload: true // so that we don't have to call loadDatabase()\n  })\n\n  await DB.insert([{\n    num: 1, alpha: 'a'\n  }, {\n    num: 2, alpha: 'b'\n  }])\n\n  let document = await DB.findOne({ num: 1 })\n\n  // use NeDB cursors:\n  let documents = await DB.cfind({})\n    .projection({ num: 1, _id: 0 })\n    .exec()\n}\n\ndoDatabaseStuff()\n```\n\nAPI\n===\n\n## datastore(options)\n\nReturns an object that proxies to an internal `nedb.Datastore` instance (`options` are passed through to the NeDB constructor), with promisified methods.\n\nIt also includes extension methods `cfind(...)`, `cfindOne(...)`, and `ccount(...)` that return promisified cursors, so that you may do:\n\n```javascript\nlet results = await myDataStore.cfind({ moo: 'goo' })\n  .projection({ moo: 1, _id: 0 }) // see NeDB cursor methods\n  .exec()\n```\n\n## datastore.fromInstance(nedbInstance)\n\nUse this method if you already have a NeDB instance that you want to wrap with the promisified methods.\n\nTesting\n=======\n\nRun tests with mocha (after building):\n\n```\n$ mocha test.js\n```\n\nLicense\n=======\nCopyright (c) 2015, Jonathan Apodaca \u003cjrapodaca@gmail.com\u003e\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrop%2Fnedb-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrop%2Fnedb-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrop%2Fnedb-promise/lists"}