{"id":16731606,"url":"https://github.com/missinglink/naivedb","last_synced_at":"2025-10-13T23:34:34.701Z","repository":{"id":28006393,"uuid":"31500872","full_name":"missinglink/naivedb","owner":"missinglink","description":"minimal viable database","archived":false,"fork":false,"pushed_at":"2016-07-08T11:32:37.000Z","size":7,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T18:58:24.273Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/missinglink.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":"2015-03-01T15:37:57.000Z","updated_at":"2023-03-14T15:18:25.000Z","dependencies_parsed_at":"2022-08-01T12:47:22.695Z","dependency_job_id":null,"html_url":"https://github.com/missinglink/naivedb","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/missinglink%2Fnaivedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnaivedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnaivedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/missinglink%2Fnaivedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/missinglink","download_url":"https://codeload.github.com/missinglink/naivedb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208603,"owners_count":21065203,"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-10-12T23:38:07.537Z","updated_at":"2025-10-13T23:34:29.659Z","avatar_url":"https://github.com/missinglink.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Install\n\n```bash\nnpm install naivedb --save\n```\n\n[![NPM](https://nodei.co/npm/naivedb.png?downloads=true\u0026stars=true)](https://nodei.co/npm/naivedb/)\n\n---\n\n## Minimum viable database\n\nIt would be hard to make something that did less.\n\n## Create your database\n\nYep, those 2 squiggly brackets are your whole database, deal with it.\n\n```bash\necho '{}' \u003e /tmp/database.json\n```\n\nor you can do it with javascript..\n\n```javascript\nvar fs = require('fs');\nfs.writeFileSync( '/tmp/database.json', '{}' );\n```\n\n## Usage\n\n```bash\n$ node\n\u003e var naivedb = require('naivedb');\nundefined\n\u003e var db = naivedb('/tmp/database.json');\nundefined\n\u003e db.set( 'foo', 'bar' );\nundefined\n\u003e db.get( 'foo' );\n'bar'\n\u003e db.del( 'foo' );\nundefined\n\u003e db.get( 'foo' );\nundefined\n```\n\n... pretty mind-blowing stuff huh?\n\n## Streaming writes\n\nStreams are max radical to the power of sick, you probably still use callbacks, deal with it.\n\n```javascript\nvar request = require('request'),\n    naivedb = require('naivedb'),\n    through = require('through2');\n\nrequest\n  .get( 'https://graph.facebook.com/yournamehere' )\n  .pipe( through.obj( function( chunk, enc, next ){\n    this.push( JSON.parse( chunk.toString('utf8') ) );\n    next();\n  }))\n  .pipe( naivedb('/tmp/res.json').createWriteStream() )\n```\n\n## Options\n\n```javascript\nvar naivedb = require('naivedb');\nvar db = naivedb('/tmp/database.json', { safeMode: true, pretty: true } );\n```\n\nPass in the path to your db, if it doesnt exist you will get a fatal error, that's the computers way of telling you that you should have read the manual.\n\n`safeMode` - this defaults to `true`, if you set it to `false` then the db will not write to disk when the process exits, i'm not sure why you would want this turned off.\n\n`pretty` - again; this defaults to `true`, if you set it to `false` then the json is un-readable and you should probably be using a better database.\n\n---\n\n## License\n\n[Poetic Licence 1.0](https://github.com/alexgenaud/Poetic-License)\n\n```\nThis work ‘as-is’ we provide.\nNo warranty express or implied.\n  We’ve done our best,\n  to debug and test.\nLiability for damages denied.\n\nPermission is granted hereby,\nto copy, share, and modify.\n  Use as is fit,\n  free or for profit.\nThese rights, on this notice, rely.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fnaivedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmissinglink%2Fnaivedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissinglink%2Fnaivedb/lists"}