{"id":44923267,"url":"https://github.com/fabriquebeweb/dao","last_synced_at":"2026-02-18T04:00:55.926Z","repository":{"id":42654267,"uuid":"364251963","full_name":"fabriquebeweb/dao","owner":"fabriquebeweb","description":"Le 'Data Access Object' pour les nuls !","archived":false,"fork":false,"pushed_at":"2023-09-27T21:40:27.000Z","size":1595,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T01:37:45.703Z","etag":null,"topics":["dao","data","npm","package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@beweb/dao","language":"TypeScript","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/fabriquebeweb.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,"zenodo":null}},"created_at":"2021-05-04T12:41:22.000Z","updated_at":"2024-03-17T16:03:45.000Z","dependencies_parsed_at":"2025-08-18T15:31:00.933Z","dependency_job_id":"c589ecae-fff6-47e6-8de8-23078fb8fc62","html_url":"https://github.com/fabriquebeweb/dao","commit_stats":{"total_commits":52,"total_committers":4,"mean_commits":13.0,"dds":"0.28846153846153844","last_synced_commit":"db404ff7fcf71491c20c450cc8c3f3aa7ad55176"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fabriquebeweb/dao","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriquebeweb%2Fdao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriquebeweb%2Fdao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriquebeweb%2Fdao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriquebeweb%2Fdao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabriquebeweb","download_url":"https://codeload.github.com/fabriquebeweb/dao/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabriquebeweb%2Fdao/sbom","scorecard":{"id":382218,"data":{"date":"2025-08-11","repo":{"name":"github.com/fabriquebeweb/dao","commit":"5bbdf0de3deb671d4fe35c31e790686dd0ff0d0d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":3,"reason":"Found 3/9 approved changesets -- score normalized to 3","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":"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":"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":"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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 24 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":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-18T15:44:00.179Z","repository_id":42654267,"created_at":"2025-08-18T15:44:00.179Z","updated_at":"2025-08-18T15:44:00.179Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29567616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dao","data","npm","package"],"created_at":"2026-02-18T04:00:28.013Z","updated_at":"2026-02-18T04:00:55.887Z","avatar_url":"https://github.com/fabriquebeweb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![favicon.png](https://i.postimg.cc/1Xx1HPsj/favicon.png)](https://postimg.cc/G8jfLWBF)\n\n# PRÉSENTATION\nLe Data Access Object (DAO) est un modèle de programmation qui permet à un serveur de traiter des requêtes d'accès aux données de différentes Bases De Données (DB).\n\nLorsque le serveur reçoit des requêtes, le DAO s'occupe de les traduire avant de les envoyer au bon format, peu importe la DB choisie.\n\n# INSTALLATION\n- Installation de la librairie via `npm`\n```bash\n$ npm install @beweb/dao\n```\n- Import de la librairie\n```js\nconst DAO = require('@beweb/dao')\n```\n- Instanciation d'une nouvelle DB dans une variable (chemin vers la DB)\n\nSQLite\n```js\nconst db = new DAO.SQLite('/uri/of/database')\n```\nMySQL\n```js\nconst db = new DAO.MySQL('/uri/of/database')\n```\nMongoDB\n```js\nconst db = new DAO.MongoDB('/uri/of/database')\n```\nRedis\n```js\nconst db = new DAO.Redis('/uri/of/database')\n```\n# UTILISATION\n\n`db` : Instance du DAO lié à la Base De Données ciblée\n\n`'target'` : Collection MongoDB / Table SQL / Clé Redis\n\n`element` : Objet JavaScript a récupérer / insérer / mettre à jour\n\n`id` : ID de l'Objet JavaScript à obtenir / supprimer\n\n`callback` : Traitement à effectuer une fois les valeurs récupérées\n\n- create(`'target'`, `element`) ajoute un élement à la cible \n```js\nlet new_element = {}\ndb.create('example', new_element)\n```\n- getAll(`'target'`, `callback()`) retourne toutes les données de la cible\n```js\ndb.getAll('example', elements =\u003e {\n    console.log(elements)\n})\n```\n- getById(`'target'`, `id`, `callback()`) retourne la donnée correspondant à l'ID dans la cible\n```js\ndb.getById('example', element.id, element =\u003e {\n    console.log(element)\n})\n```\n- update(`'target'`, `element`) modifie une donnée dans la cible\n```js\nupdated_element.key = new_value\ndb.update('example', updated_element)\n```\n- delete(`'target'`, `id`) retire une donnée de la cible\n```js\ndb.delete('example', element.id)\n```\n- seed(`'target'`, `elements`) remplie la cible avec une liste d'éléments\n\u003e **ATTENTION** cette méthode réinitialise la cible, et ne doit être utilisée que pour des tests\n```js\ndb.seed('example', elements)\n```\n- `path` représente le chemin de la DB fournie\n\u003e **ATTENTION** modifier le `path` peut être dangereux pour l'intégrité des données\n```js\ndb.path = './databases/new.db'\n```\n\n\u003e Toutes les méthodes peuvent prendre une fonction de `callback` en dernier paramètre pour pouvoir gérer les réponses des requêtes, et les erreurs peuvent être gérées avec `try` et `catch`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabriquebeweb%2Fdao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabriquebeweb%2Fdao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabriquebeweb%2Fdao/lists"}