{"id":18784896,"url":"https://github.com/ghostbar/hapi-rethinkdb","last_synced_at":"2025-04-13T12:33:31.585Z","repository":{"id":28014702,"uuid":"31509423","full_name":"ghostbar/hapi-rethinkdb","owner":"ghostbar","description":"RethinkDB plugin for Hapi","archived":false,"fork":false,"pushed_at":"2016-08-18T01:09:08.000Z","size":34,"stargazers_count":13,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-16T10:31:46.993Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostbar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"2015-03-01T20:23:28.000Z","updated_at":"2019-12-06T21:14:01.000Z","dependencies_parsed_at":"2022-08-31T12:21:21.119Z","dependency_job_id":null,"html_url":"https://github.com/ghostbar/hapi-rethinkdb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fhapi-rethinkdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fhapi-rethinkdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fhapi-rethinkdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostbar%2Fhapi-rethinkdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostbar","download_url":"https://codeload.github.com/ghostbar/hapi-rethinkdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714734,"owners_count":21149958,"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-11-07T20:44:23.854Z","updated_at":"2025-04-13T12:33:31.343Z","avatar_url":"https://github.com/ghostbar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"hapi-rethinkdb\n==============\n\nHapi (\u003e=8.0) plugin for `rethinkdb` [native driver](https://www.npmjs.com/package/rethinkdb).\n\nInstall hapi-rethinkdb\n----------------------\n\n    npm install --save rethinkdb hapi-rethinkdb\n\nRegister plugin\n---------------\n\nYou can pass as options either an URL or `host` and `port`. Obviously passing an URL is way more convenient (specially for 12factor-compliant apps).\n```js\n    var Hapi = require('hapi');\n    var server = new Hapi.Server();\n\n    server.register({\n      register: require('hapi-rethinkdb'),\n      options: { url: 'rethinkdb://:password@domain.tld:port/dbname' }\n    }, function (err) {\n      if (err) console.error(err);\n    });\n```\n\n##### Options\n* `url`: the URL of your RethinkDB instance in form `rethinkdb://password@domain.tld:port/dbname`, default to `rethinkdb://localhost:28015/test`\n\nor\n\n* `host`: the hostname of your RethinkDB instance, default to `localhost`\n* `port`: the port of your RethinkDB instance, default to `28015`\n* `db`: the name of your RethinkDB database, default to `test`\n* `password`: the authentication key to access your RethinkDB, defaults to *no password*\n\n\nUse plugin\n----------\n\nThe connection object returned by `rethinkdb.connect` callback is exposed on `server.plugins['hapi-rethinkdb'].connection` and binded to the context on routes and extensions as `this.rethinkdbConn`. You can find the `rethinkdb` library itself exposed on `server.plugins['hapi-rethinkdb'].library` and `server.plugins['hapi-rethinkdb'].rethinkdb` or binded to the context on routes and extensions as `this.rethinkdb`.\n\nFrom a handler you can use it like:\n\n```js\n    function handler (request, response) {\n      var r = request.server.plugins['hapi-rethinkdb'].rethinkdb;\n      // r === this.rethinkdb;\n\n      var conn = request.server.plugins['hapi-rethinkdb'].connection;\n      // conn === this.rethinkdbConn;\n\n      r.table('example').run(conn, function (err, cursor) {\n        cursor.each(console.log);\n      });\n    }\n```\n\nLicense\n-------\n\nLicensed under the terms of the ISC. A copy of the license can be found in the file `LICENSE`.\n\n© 2015, Jose-Luis Rivas `\u003cme@ghostbar.co\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbar%2Fhapi-rethinkdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostbar%2Fhapi-rethinkdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostbar%2Fhapi-rethinkdb/lists"}