{"id":27838182,"url":"https://github.com/datproject/dat-registry-client","last_synced_at":"2025-05-02T23:01:56.243Z","repository":{"id":71173857,"uuid":"82666141","full_name":"dat-ecosystem-archive/dat-registry-client","owner":"dat-ecosystem-archive","description":"Node.js Client for datBase [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ] ","archived":true,"fork":false,"pushed_at":"2022-01-06T16:20:05.000Z","size":48,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-22T10:12:13.222Z","etag":null,"topics":["client","data","javascript","node","nodejs","p2p","registry"],"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","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-02-21T10:17:51.000Z","updated_at":"2023-01-28T04:17:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d0f468c-0ecf-401e-8924-5ca49308329f","html_url":"https://github.com/dat-ecosystem-archive/dat-registry-client","commit_stats":null,"previous_names":["datproject/dat-registry-client"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-registry-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-registry-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-registry-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dat-ecosystem-archive%2Fdat-registry-client/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-registry-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252118316,"owners_count":21697583,"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":["client","data","javascript","node","nodejs","p2p","registry"],"created_at":"2025-05-02T23:01:55.743Z","updated_at":"2025-05-02T23:01:56.233Z","avatar_url":"https://github.com/dat-ecosystem-archive.png","language":"JavaScript","funding_links":[],"categories":["Using Dat"],"sub_categories":["Hosting \u0026 Dat Management"],"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-registry\n\n[![Build Status](https://travis-ci.org/datproject/dat-registry-client.svg?branch=master)](https://travis-ci.org/datproject/dat-registry-client)\n\nAPI Registry Client for publishing dats. By default, the client is capable of registering, login, and publishing to datbase.org.\n\n`dat-registry` allows users to interact with and publish dats to your registry via the `dat` command line. Supporting this module on your registry will allow a user to login and publish:\n\n```\ndat login custom-dat-registry.com\ndat publish\n```\n\n## Installation\n\n```\nnpm install dat-registry\n```\n\n### Quick Example\n\n```js\nvar Registry = require('dat-registry')\n\nvar registry = Registry()\n\nregistry.login({email: 'karissa', password: 'my passw0rd r0cks!'}, function () {\n  registry.dats.create({\n    name: 'animal-names',\n    url: 'dat://378d23adf22df',\n    title: 'Animal Names',\n    description: 'I did a study on animals for a very important Nature study, here are the spreadsheets with raw animals in them.'\n  }, function (err, resp, json) {\n    if (err) throw err\n    if (resp.statusCode === 400) console.error(data.message)\n    console.log('Published successfully!')\n    // Created a nickname for a dat at `https://datbase.org/karissa/animal-names`\n  })\n})\n```\n\n### API\n\n#### `var registry = Registry([opts])`\n\n  * `opts.server`: the registry server. Default is `https://datbase.org`\n  * `opts.apiPath`: registery server API path, e.g. we use `/api/v1` for datbase.org. This will overwrite default township routes to use server + apiPath.\n  * `opts.config.filename`: defaults to `~.datrc` instead of township defaults.\n\nOther options are passed to [township-client](https://github.com/township/township-client), these include:\n\n```js\nopts = {\n  config: {\n    filepath: '~/.townshiprc' // specify a full config file path \n  },\n  routes: { // routes for ALL township servers used by client\n    register: '/register',\n    login: '/login',\n    updatePassword: '/updatepassword'\n  }\n}\n```\n\n#### `registry.login(data, cb)`\n\nRequires `data.email` and `data.password`.\n\n#### `registry.register(data, cb)`\n\nRequires `data.username`, `data.email`, and `data.password`.\n\n#### `registry.logout(cb)`\n\nWill callback with logout success or failure.\n\n#### `var user = registry.whoami([opts])`\n\nReturns user object with currently logged in user. See `township-client` for options.\n\n### CRUD API\n\n#### `registry.dats.create(data, cb)`\n\nMust be logged in. Requires a unique `data.name` and unique `data.url`. Dat will be immediately available on the `/:username/:name`.\n\nAccepts also any fields in a `dat.json` file.\n\n#### `registry.dats.get([data], cb)`\n\nReturns all dats that match the given (optional) querystrings.\n\n#### `registry.dats.update(data, cb)`\n#### `registry.dats.delete(data, cb)`\n#### `registry.users.get([data], cb)`\n#### `registry.users.update(data, cb)`\n#### `registry.users.delete(data, cb)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatproject%2Fdat-registry-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatproject%2Fdat-registry-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatproject%2Fdat-registry-client/lists"}