{"id":16516177,"url":"https://github.com/gavinhungry/rudiment","last_synced_at":"2026-05-17T11:34:32.856Z","repository":{"id":143907150,"uuid":"37875908","full_name":"gavinhungry/rudiment","owner":"gavinhungry","description":"CRUD resource manager","archived":false,"fork":false,"pushed_at":"2022-03-01T17:27:49.000Z","size":43,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T05:42:25.175Z","etag":null,"topics":["crud","database","schema"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rudiment","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/gavinhungry.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-22T19:24:02.000Z","updated_at":"2023-05-01T20:42:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc0f3149-f2fb-4069-8c60-1118771c8324","html_url":"https://github.com/gavinhungry/rudiment","commit_stats":{"total_commits":79,"total_committers":1,"mean_commits":79.0,"dds":0.0,"last_synced_commit":"b4e77deb794d11bcae5598736905bb630ee65329"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/gavinhungry/rudiment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinhungry%2Frudiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinhungry%2Frudiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinhungry%2Frudiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinhungry%2Frudiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gavinhungry","download_url":"https://codeload.github.com/gavinhungry/rudiment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gavinhungry%2Frudiment/sbom","scorecard":{"id":419965,"data":{"date":"2025-08-11","repo":{"name":"github.com/gavinhungry/rudiment","commit":"b4e77deb794d11bcae5598736905bb630ee65329"},"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":"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":"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":"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":"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":"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 'main'"],"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-19T00:57:00.399Z","repository_id":143907150,"created_at":"2025-08-19T00:57:00.400Z","updated_at":"2025-08-19T00:57:00.400Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33136820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"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":["crud","database","schema"],"created_at":"2024-10-11T16:19:51.270Z","updated_at":"2026-05-17T11:34:32.840Z","avatar_url":"https://github.com/gavinhungry.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"rudiment\n========\nA resource manager providing simplified database methods for CRUD operations.\n\nInstallation\n------------\n\n    $ npm install rudiment\n\nUsage\n-----\n\n```javascript\nvar Rudiment = require('rudiment');\n```\n\n```javascript\nvar db = require('rethinkdbdash')();\nvar schema = require('js-schema');\n\nvar users = new Rudiment({\n  db: db.table('users'),\n  schema: schema({\n    username: String,\n    name: String,\n  }),\n\n  key: 'username',\n  index: 'uid'\n});\n```\n\n#### Options\n`db`: Existing database table object to use. For `rethinkdb`, the suggested\nmodule is [`rethinkdbdash`](https://www.npmjs.com/package/rethinkdbdash).\n\n`schema`: Optional schema function (or an array of schema functions). These may\nbe custom predicate functions, or functions returned by a schema library like\n[`js-schema`](https://www.npmjs.com/package/js-schema).\n\n`props`: Optional array of whitelisted property names to keep in proposed\ndocuments before creating or updating. If using `js-schema`, this option is not\nneeded, as the properties will be extracted from the schema.\n\n`key`: Optional property name to be used as unique key.\n\n`index`: Optional property name to use as an auto-index, starting at 0.\n\n`uniq`: Optional array of property names to be considered unique (database ID,\n`key` and `index` are automatically included).\n\n`in`: Optional map function for documents being created or updated.\n\n`out`: Optional map function for documents being read.\n\n`path`: Optional REST path.\n\nMethods\n-------\n\n### getSupportedDbTypes\nReturn an array of all supported database types.\n\n```javascript\nRudiment.getSupportedDbTypes();\n// ['rethinkdb']\n```\n\n### Prototype Methods\n\nAll methods may be overridden by the constructor.\n\n### getDbType\nGet the detected database type.\n```javascript\nusers.getDbType();\n// 'rethinkdb'\n```\n\n### getNextIndex\nIf using auto-indexing (`index`), generate a unique numeric index\n(starting at `0`) to use a pseudo-key.\n\n```javascript\nusers.getNextIndex().then(function(index) {\n  // ...\n});\n```\n\n### clean\nRemove extraneous properties from a proposed document. This method only works if\nthe first defined schema is a `js-schema` object, or if the `props` option is\nprovided.\n\n```javascript\nusers.clean({\n  username: 'foo',\n  name: 'Foo',\n  color: 'blue' // this property is not part of the defined schema\n});\n\n// { username: 'foo', name: 'Foo' }\n```\n\n### isValid\nCheck if a proposed document is valid by comparing it to the defined schema(s).\n\n```javascript\nusers.isValid({ username: 'foo', name: 'Foo' });\n// true\n\n// `name` should be a String\nusers.isValid({ username: 'foo', name: 200 });\n// false\n\n// Extraneous properties are ignored here\nusers.isValid({ username: 'foo', name: 'Foo', color: 'green' });\n// true\n```\n\n### isAdmissible\nCheck if a proposed document is admissible into the database. An admissible\ndocument should pass `isValid` and not have any unique properties with values\nthat are already present in the database.\n\n```javascript\nusers.isAdmissible({\n  username: 'foo'\n  name: 'Foo'\n}).then(function(ok) {\n  // `ok` is true if admissible, false otherwise\n});\n```\n\n### create\nCreate and insert a new document into the database.\n\n```javascript\nusers.create({\n  username: 'foo',\n  name: 'Foo'\n}).then(function(doc) {\n  // `doc` is newly inserted document\n});\n```\n\n### find\nGet all documents from the database with matching properties.\n\n```javascript\nusers.find({\n  name: 'Foo'\n}).then(function(docs) {\n  // `docs` is an array of matching documents\n});\n```\n\n### read\nGet a document from the database by database ID.\n\n```javascript\nusers.read('foo-db-id').then(function(doc) {\n  // `doc` is matching document\n});\n```\n\n### readByKey\nGet a document from the database by key.\n\n```javascript\nusers.readByKey('foo').then(function(doc) {\n  // `doc` is matching document\n});\n```\n\n### readByIndex\nGet a document from the database by auto-index.\n\n```javascript\nusers.readByIndex(0).then(function(doc) {\n  // `doc` is matching document\n});\n```\n\n### readAll\nGet all documents from the database.\n\n```javascript\nusers.readAll().then(function(docs) {\n  // `docs` is an array of all documents\n});\n```\n\n### update\nUpdate a document in the database by database ID.\n\n```javascript\nusers.update('foo-db-id', {\n  name: 'Dr. Foo'\n}).then(function(doc) {\n  // `doc` is updated document\n});\n```\n\n### updateByKey\nUpdate a document in the database by key.\n\n```javascript\nusers.updateByKey('foo', {\n  name: 'Dr. Foo'\n}).then(function(doc) {\n  // `doc` is updated document\n});\n```\n\n### updateByIndex\nUpdate a document in the database by auto-index.\n\n```javascript\nusers.updateByIndex(0, {\n  name: 'Dr. Foo'\n}).then(function(doc) {\n  // `doc` is updated document\n});\n```\n\n### delete\nDelete a document from the database by database ID.\n\n```javascript\nusers.delete('foo-db-id').then(function() {\n  // document was deleted\n});\n```\n\n### deleteByKey\nDelete a document from the database by key.\n\n```javascript\nusers.deleteByKey('foo').then(function() {\n  // document was deleted\n});\n```\n\n### deleteByIndex\nDelete a document from the database by auto-index.\n\n```javascript\nusers.deleteByIndex(0).then(function() {\n  // document was deleted\n});\n```\n\n### rest\nMiddleware REST handler for CRUD operations.\n\n```javascript\napi.post('/users', function(req, res) {\n  users.rest(users.create(req.body), res);\n});\n```\n\nLicense\n-------\nThis software is released under the terms of the MIT license. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinhungry%2Frudiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgavinhungry%2Frudiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgavinhungry%2Frudiment/lists"}