{"id":13928839,"url":"https://github.com/lmangani/fastify-gundb","last_synced_at":"2025-05-05T19:35:07.281Z","repository":{"id":48032787,"uuid":"109758417","full_name":"lmangani/fastify-gundb","owner":"lmangani","description":"Plugin to share a common GunDB connection across Fastify :gun:","archived":false,"fork":false,"pushed_at":"2022-12-06T17:14:19.000Z","size":277,"stargazers_count":21,"open_issues_count":5,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T00:44:27.488Z","etag":null,"topics":["fastify","graph","gun","gundb","nodejs"],"latest_commit_sha":null,"homepage":"https://gundb.io","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/lmangani.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":"2017-11-06T22:40:13.000Z","updated_at":"2022-10-07T07:52:48.000Z","dependencies_parsed_at":"2023-01-24T10:16:08.614Z","dependency_job_id":null,"html_url":"https://github.com/lmangani/fastify-gundb","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/lmangani%2Ffastify-gundb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Ffastify-gundb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Ffastify-gundb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmangani%2Ffastify-gundb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmangani","download_url":"https://codeload.github.com/lmangani/fastify-gundb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252563029,"owners_count":21768389,"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":["fastify","graph","gun","gundb","nodejs"],"created_at":"2024-08-07T18:01:52.428Z","updated_at":"2025-05-05T19:35:07.245Z","avatar_url":"https://github.com/lmangani.png","language":"JavaScript","funding_links":[],"categories":["nodejs","JavaScript"],"sub_categories":[],"readme":"\u003cp\u003e\n    \u003ca href=\"http://gun.js.org/\"\u003e\u003cimg width=\"25%\" src=\"https://cldup.com/TEy9yGh45l.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e \n\n# fastify-gundb\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)  [![Build Status](https://travis-ci.org/lmangani/fastify-gundb.svg?branch=master)](https://travis-ci.org/lmangani/fastify-gundb)\n\n\nFastify [GunDB](http://gundb.io) connection plugin, with this you can share a Gun instance in every part of your server.\n\n## Install\n```\nnpm i fastify-gundb --save\n```\n## Usage\nAdd it to you project with `register` and you are done!  \nYou can access Gun via `fastify.gun`.\n```js\nconst fastify = require('fastify')\n\nfastify.register(require('fastify-gundb'), {\n  name: 'db'\n}, err =\u003e {\n  if (err) throw err\n})\n\nfastify.get('/foo', (req, reply) =\u003e {\n  const { gun } = fastify.gun\n  gun.get(req.query.key).once(function(val){\n    if (!val) val = { status: 404 }  \n    reply.send(val)\n  })\n})\n\nfastify.post('/foo', (req, reply) =\u003e {\n  const { gun } = fastify.gun\n  gun.get(req.body.key).put(req.body.value, (ack) =\u003e {\n    if (!ack) val = { status: 'error' }  \n    reply.send({ status: 'ok' })\n  })\n})\n\nfastify.listen(3000, err =\u003e {\n  if (err) throw err\n  console.log(`server listening on ${fastify.server.address().port}`)\n})\n```\n\n## Acknowledgements\n\nThis project is kindly sponsored by:\n- [QXIP](http://qxip.net)\n\nFastify is kindly sponsored by:\n- [nearForm](http://nearform.com)\n- [LetzDoIt](http://www.letzdoitapp.com/)\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmangani%2Ffastify-gundb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmangani%2Ffastify-gundb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmangani%2Ffastify-gundb/lists"}