{"id":23276264,"url":"https://github.com/dinoscapeprogramming/database-framework","last_synced_at":"2025-04-06T11:45:16.277Z","repository":{"id":144663937,"uuid":"458778366","full_name":"DinoscapeProgramming/database-framework","owner":"DinoscapeProgramming","description":"A simple database using fs","archived":false,"fork":false,"pushed_at":"2022-03-02T18:32:25.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T17:28:30.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DinoscapeProgramming.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":"2022-02-13T10:38:54.000Z","updated_at":"2022-02-14T18:11:40.000Z","dependencies_parsed_at":"2024-03-30T23:15:14.005Z","dependency_job_id":null,"html_url":"https://github.com/DinoscapeProgramming/database-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2Fdatabase-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2Fdatabase-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2Fdatabase-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoscapeProgramming%2Fdatabase-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DinoscapeProgramming","download_url":"https://codeload.github.com/DinoscapeProgramming/database-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478254,"owners_count":20945262,"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-12-19T21:30:17.957Z","updated_at":"2025-04-06T11:45:16.254Z","avatar_url":"https://github.com/DinoscapeProgramming.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database Template\nA database template programmed with fs and using arrays\n\n## Get started\nFirst copy the file __database-template.js__ to your program. Then create a JSON file with ``` [] ``` as content or add this to your code:\n```js\ndatabase.setup('./database.json')\n```\nNow you're ready to use this database framwork!\n\n## Introduction\n### Require the framework\n```js\nconst database = require('./database-template.json');\n```\n\n### Add an element to a database\n```js\ndatabase.add('./database.json', 'hello')\n```\n\n### Remove an element from a database\n```js\ndatabase.remove('./database.json', 'world')\n```\n\n### Get an element from a database\n```js\ndatabase.get('./database.json', 'how are you')\n```\n\n### Change an element from a database\n```js\ndatabase.set('./database.json', 'world', 'guys')\n```\n\n### Change an element from a database by id\n```js\ndatabase.set('./database.json', database.get('./database.json', 2), 'github')\n```\n\n### Has database an element\n```js\ndatabase.has('./database.json', 'i am fine') // replies with true or false\n```\n\n### Clear a database\n```js\ndatabase.clear('./database.json')\n```\n\n### Get a whole database\n```js\ndatabase.all('./database.json', i am fine') // replies with an array\n```\n\n### Unsetup a database\n```js\ndatabase.unsetup('./database.json')\n```\n\n## Example\n```js\nconst database = require('./database-template.js');\nconst settings = {\n  file: './database.json'\n}\n\ndatabase.setup(settings.file)\n\ndatabase.clear(settings.file)\n\ndatabase.add(settings.file, \"Hello\")\n\ndatabase.add(settings.file, \"World\")\n\ndatabase.add(settings.file, \"!\")\n\ndatabase.remove(settings.file, \"World\")\n\nif (database.has(settings.file, \"World\") {\n  console.log(\"How are you?\")\n} else {\n  console.log(\"How are you all on the world?\")\n}\n\ndatabase.set(settings.file, \"World\", \"You there\")\n\nconsole.log(database.all(settings.file))\n\ndatabase.unsetup(settings.file)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoscapeprogramming%2Fdatabase-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinoscapeprogramming%2Fdatabase-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinoscapeprogramming%2Fdatabase-framework/lists"}