{"id":21822160,"url":"https://github.com/ethiclab/crud-git","last_synced_at":"2026-04-09T23:02:17.226Z","repository":{"id":57112153,"uuid":"302067479","full_name":"ethiclab/crud-git","owner":"ethiclab","description":"Git implementation of crud-mongo (https://github.com/ethiclab/crud-mongo)","archived":false,"fork":false,"pushed_at":"2020-10-21T16:42:29.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T22:02:01.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ethiclab.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":"2020-10-07T14:46:19.000Z","updated_at":"2022-11-23T20:28:22.000Z","dependencies_parsed_at":"2022-08-21T10:31:07.674Z","dependency_job_id":null,"html_url":"https://github.com/ethiclab/crud-git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ethiclab/crud-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethiclab%2Fcrud-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethiclab%2Fcrud-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethiclab%2Fcrud-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethiclab%2Fcrud-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethiclab","download_url":"https://codeload.github.com/ethiclab/crud-git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethiclab%2Fcrud-git/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260563493,"owners_count":23028565,"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":[],"created_at":"2024-11-27T17:13:25.824Z","updated_at":"2026-04-09T23:02:17.176Z","avatar_url":"https://github.com/ethiclab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crud-git\n\n    npm install @ethiclab/crud-git\n\n# status\n\nDevelopment in progress.\n\n# usage\n\nA simple example, with no actual express router, only for testing purposes.\n\n```javascript\nconst crud = require(\"@ethiclab/crud-git\");\n(async () =\u003e {\n  const controller = await crud({\n    url: 'https://github.com/ethiclab/samplegitdb.git',\n    databaseName: 'sys',\n    root: '/',\n    router: {\n      get: () =\u003e {\n        return {}\n      },\n      post: () =\u003e {\n        return {}\n      },\n      put: () =\u003e {\n        return {}\n      },\n      delete: () =\u003e {\n        return {}\n      }\n    },\n    col: 'mycollection'\n  })\n  const x = await controller.create({\n    name: 'test object'\n  })\n  console.log(x)\n})()\n```\n\nThe property databaseName refers to a folder in the repository.\n\nBehaviour depends on the kind of the filesystem file 'mycollection'\n\n1. If it is a folder, then items are also folders named with a key (TODO: how to generate the key?)\n2. In case of a text file, the items are the single rows of that file.\n\nAn example using express router.\n\n```javascript\nconst crud = require(\"@ethiclab/crud-git\");\nconst express = require('express')\nconst app = express()\nconst router = express.Router()\n\ncrud({\n    url: 'https://github.com/ethiclab/samplegitdb.git',\n    databaseName: 'sys',\n    root: '/',\n    router: router,\n    col: 'mycollection'\n})\n\napp.use((req, res, next) =\u003e {\n  router(req, res, next)\n})\n\napp.listen(12345)\n```\n\nThen, you can visit:\n\nhttp://localhost:12345/mycollection\n\nYou can also use, for instance, Postman, for creating, updating and deleting records.\n\nThe following endpoints are defined:\n\n    GET /mycollection\n    POST /mycollection\n    GET /mycollection/:id\n    PUT /mycollection/:id\n    DELETE /mycollection/:id\n\n# where are the schemas?\n\nThis is a low level library for storing arbitrary documents with arbitrary properties\nin order to support new properties, therefore, we decided not to add schema support\nat this level.\n\n# test\n\n    GITHUB_TOKEN=\u003cyour token\u003e npm test\n\n# test server\n\n    node test/server.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethiclab%2Fcrud-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethiclab%2Fcrud-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethiclab%2Fcrud-git/lists"}