{"id":13541010,"url":"https://github.com/dat-ecosystem-archive/dat-json","last_synced_at":"2025-12-15T17:42:46.366Z","repository":{"id":71173853,"uuid":"88899786","full_name":"dat-ecosystem-archive/dat-json","owner":"dat-ecosystem-archive","description":"manage dat.json file via toiletdb [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ] ","archived":true,"fork":false,"pushed_at":"2022-01-06T16:48:50.000Z","size":33,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-11T20:31:01.484Z","etag":null,"topics":["dat"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dat-ecosystem-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-04-20T18:49:49.000Z","updated_at":"2024-07-25T09:12:44.278Z","dependencies_parsed_at":null,"dependency_job_id":"6c23dbb1-28b0-4f5e-ace0-5d3d8a8d09f3","html_url":"https://github.com/dat-ecosystem-archive/dat-json","commit_stats":null,"previous_names":["joehand/dat-json"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dat-ecosystem-archive","download_url":"https://codeload.github.com/dat-ecosystem-archive/dat-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781925,"owners_count":20832934,"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":["dat"],"created_at":"2024-08-01T10:00:37.342Z","updated_at":"2025-12-15T17:42:46.306Z","avatar_url":"https://github.com/dat-ecosystem-archive.png","language":"JavaScript","readme":"[![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](https://dat-ecosystem.org/) \n\nMore info on active projects and modules at [dat-ecosystem.org](https://dat-ecosystem.org/) \u003cimg src=\"https://i.imgur.com/qZWlO1y.jpg\" width=\"30\" height=\"30\" /\u003e \n\n---\n\n# dat-json\n\nread \u0026amp; write dat.json files. Uses toiletdb under the hood.\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![standard][standard-image]][standard-url]\n\n## Install\n\n```\nnpm install dat-json\n```\n\n## Usage\n\n```js\nvar DatJSON = require('dat-json')\n\nvar datjson = DatJSON(archive)\n\nawait datjson.create({title: 'a dat', description: 'exciting'})\n\nconsole.log(await datjson.read())\n```\n\nWrite to a `dat.json` on the file system also:\n\n```js\nvar DatJSON = require('dat-json')\n\nvar datjson = DatJSON(archive, {file: path.join(dat.path, 'dat.json')})\n\nawait datjson.create({title: 'a dat', description: 'exciting'})\n```\n\n**TODO: replace file option with hyperdrive indexing**\n\n## API\n\n### `var datjson = DatJSON(archive, [opts])`\n\ncreate a new datJson db\n\nOptions:\n\n* `opts.file` - dat.json file path, updates will be written to file system and archive\n\n#### `await datjson.create([data])`\n\nCreate a new `dat.json` file in the archive with the default keys (`url`, `title`, `description`). Pass in any additional data to add on initial create.\n\n#### `await datjson.write(key, val)` or `await datjson.write(data)`\n\nWrite a single `key` and `value` or an object, `data`, to the `dat.json` file. Use `file` option above to also update the file on the file system.\n\n#### `await datjson.delete(key)`\n\nDelete a `key` from the `dat.json` file.\n\n#### `await datjson.read()`\n\nRead the current `dat.json`.\n\n## License\n\n[MIT](LICENSE.md)\n\n[npm-image]: https://img.shields.io/npm/v/dat-json.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/dat-json\n[travis-image]: https://img.shields.io/travis/datproject/dat-json.svg?style=flat-square\n[travis-url]: https://travis-ci.org/datproject/dat-json\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n","funding_links":[],"categories":["Dat Core Modules"],"sub_categories":["CLI Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdat-ecosystem-archive%2Fdat-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdat-ecosystem-archive%2Fdat-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdat-ecosystem-archive%2Fdat-json/lists"}