{"id":27492126,"url":"https://github.com/valerianomacuri/lowdb","last_synced_at":"2025-04-16T23:06:54.763Z","repository":{"id":57707007,"uuid":"502740549","full_name":"valerianomacuri/lowdb","owner":"valerianomacuri","description":"Simple to use local JSON database. Powered by Go. Inspired in lowdb for Javascript","archived":false,"fork":false,"pushed_at":"2022-06-14T17:45:02.000Z","size":12,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-19T06:54:05.046Z","etag":null,"topics":["database","embedded-database","fake-api","go","golang","javascript","json","json-api","json-server","localstorage","lowdb","lowdb-adapter","nodejs","storage","toml","typecode","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","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/valerianomacuri.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}},"created_at":"2022-06-12T22:19:19.000Z","updated_at":"2023-10-20T09:58:33.000Z","dependencies_parsed_at":"2022-09-25T04:31:40.751Z","dependency_job_id":null,"html_url":"https://github.com/valerianomacuri/lowdb","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valerianomacuri%2Flowdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valerianomacuri%2Flowdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valerianomacuri%2Flowdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valerianomacuri%2Flowdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valerianomacuri","download_url":"https://codeload.github.com/valerianomacuri/lowdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249286049,"owners_count":21244296,"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":["database","embedded-database","fake-api","go","golang","javascript","json","json-api","json-server","localstorage","lowdb","lowdb-adapter","nodejs","storage","toml","typecode","yaml"],"created_at":"2025-04-16T23:06:54.252Z","updated_at":"2025-04-16T23:06:54.757Z","avatar_url":"https://github.com/valerianomacuri.png","language":"Go","funding_links":["https://www.buymeacoffee.com/golang4us"],"categories":[],"sub_categories":[],"readme":"# lowdb [![Go Reference](https://pkg.go.dev/badge/github.com/valerianomacuri/lowdb.svg)](https://pkg.go.dev/github.com/valerianomacuri/lowdb)\n\n\u003e Simple to use local JSON database. Powered by Go. Inspired in lowdb for\n\u003e Javascript\n\n```go\ndb.Data.Posts = append(\n\tdb.Data.Posts, \n\tData.Posts{ ID: 1, Title: \"lowdb is awesome\"},\n\t)\n```\n\n```json\n// db.json\n{\n  \"posts\": [\n    { \"id\": 1, \"title\": \"lowdb is awesome\" }\n  ]\n}\n```\n\n## Install\n\n```console\ngo get github.com/valerianomacuri/lowdb\n```\n\n## Usage\n\n```console\ntouch db.json \u0026\u0026 echo \"{}\" \u003e db.json\n```\n\n```json\n// db.json\n{}\n```\n\n```go\npackage main\n\nimport (\n\t\"github.com/valerianomacuri/lowdb/adapters\"\n\t\"github.com/valerianomacuri/lowdb/low\"\n)\n\n// Define the data structure for database\ntype Data struct {\n\tPosts []Post `json:\"posts\"`\n}\ntype Post struct {\n\tID    uint64 `json:\"id\"`\n\tTitle string `json:\"title\"`\n}\n\nfunc main() {\n\tadapter := adapters.NewJSONFile[Data](\"db.json\")\n\tdb := low.New[Data](adapter)\n\t// Read data from JSON file, this will set db.Data content\n\tdb.Read()\n\n\t// Finally write db.Data content to file\n\tdefer db.Write()\n\n\t// Append a post into posts array\n\tdb.Data.Posts = append(\n\t\tdb.Data.Posts,\n\t\tPost{ID: 1, Title: \"lowdb is awesome\"},\n\t)\n}\n```\n\n## Help us\n\n\u003ca href=\"https://www.buymeacoffee.com/golang4us\" target=\"_blank\"\u003e\n\u003cimg src=\"https://camo.githubusercontent.com/2e6f39f21c4d34ba1a4b01c34d27bb7e9dabb7d5c01fc8a4a2f1a571c36f4d5e/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e673f773d33383426713d3735\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalerianomacuri%2Flowdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalerianomacuri%2Flowdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalerianomacuri%2Flowdb/lists"}