{"id":16229036,"url":"https://github.com/doughtnerd/message-store-connector","last_synced_at":"2025-03-19T13:31:40.396Z","repository":{"id":42482776,"uuid":"389261709","full_name":"doughtnerd/message-store-connector","owner":"doughtnerd","description":"Client library for connecting to and operating on Eventide Project's Message DB","archived":false,"fork":false,"pushed_at":"2024-03-01T16:44:56.000Z","size":457,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T19:04:49.366Z","etag":null,"topics":["event-driven","event-sourcing","eventide","message-db","nodejs","postgres"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/doughtnerd.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":"2021-07-25T04:32:06.000Z","updated_at":"2024-08-28T10:27:34.000Z","dependencies_parsed_at":"2024-03-01T17:47:33.752Z","dependency_job_id":"799b9a54-be86-4836-9b8d-f10307921285","html_url":"https://github.com/doughtnerd/message-store-connector","commit_stats":{"total_commits":116,"total_committers":2,"mean_commits":58.0,"dds":0.06034482758620685,"last_synced_commit":"52e16bcc36367171a38fded5aa82adf26e824993"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2Fmessage-store-connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2Fmessage-store-connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2Fmessage-store-connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doughtnerd%2Fmessage-store-connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doughtnerd","download_url":"https://codeload.github.com/doughtnerd/message-store-connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243996291,"owners_count":20380977,"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":["event-driven","event-sourcing","eventide","message-db","nodejs","postgres"],"created_at":"2024-10-10T12:57:11.400Z","updated_at":"2025-03-19T13:31:40.130Z","avatar_url":"https://github.com/doughtnerd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Store Connector\nThese docs are under active development, as the library develops, better docs will be added.\n\n![Build and Deploy Workflow](https://github.com/doughtnerd/message-store-connector/actions/workflows/npm-package-workflow.yml/badge.svg)\n\n[![npm version](https://badge.fury.io/js/%40doughtnerd%2Fmessage-store-connector.svg)](https://badge.fury.io/js/%40doughtnerd%2Fmessage-store-connector)\n\n![Global Coverage](https://github.com/doughtnerd/message-store-connector/blob/master/badges/coverage-global%20coverage.svg)\n![Function Coverage](https://github.com/doughtnerd/message-store-connector/blob/master/badges/coverage-functions.svg)\n![Branch Coverage](https://github.com/doughtnerd/message-store-connector/blob/master/badges/coverage-branches.svg)\n![Lines Coverage](https://github.com/doughtnerd/message-store-connector/blob/master/badges/coverage-lines.svg)\n![Statement Coverage](https://github.com/doughtnerd/message-store-connector/blob/master/badges/coverage-statements.svg)\n\n## What is it?\nNodeJS library to connect to and operate on [Eventide Project's](http://docs.eventide-project.org/) [Message DB](http://docs.eventide-project.org/user-guide/message-db/).\n\n## Why is it?\nA long time ago, in a galaxy far far away I worked at a company that used [Event Sourcing](https://martinfowler.com/eaaDev/EventSourcing.html) and [CQRS](https://martinfowler.com/bliki/CQRS.html) - specifically utilizing Eventide's Message DB. In that company we had a JS Message DB client library supporting usage of Message DB. I really enjoyed using that library and couldn't find a better equivalent in the wild. Since I've now left that company and the proprietary library behind, I figured it would be a good idea to make my own library to facilitate my personal usage of Message DB in hobby projects.\n\n## How do I use it?\n\n### Installation\nVia npm\n```bash\nnpm install @doughtnerd/message-store-connector\n```\n\nVia yarn\n```bash\nyarn add @doughtnerd/message-store-connector\n```\n\n### Code Usage\n\n\n#### Connect\nEverything starts with a ___connection___.\nSpecifically the main export of the library is this ```connect``` function:\n```Javascript\nimport { connect } from '@doughtnerd/message-store-connector';\n```\n\nThe connect function takes a single config argument, which looks like this:\n\n```Javascript\nconst messageStoreConfig = {\n  messageStoreHost: 'localhost', // Or wherever your MessageDB is\n  messageStorePassword: 'password', // Or whatever your actual password is\n  logger: console, // The logger you want the library to use internally\n};\n```\n\nPut it all together and you have this:\n```JavaScript\nimport { connect } from '@doughtnerd/message-store-connector';\n\nconst messageStoreConfig = {\n  messageStoreHost: 'localhost', \n  messageStorePassword: 'password', \n  logger: console, \n};\n\nconnect(messageStoreConfig).then(messageStore =\u003e {\n  // Do the things!\n})\n```\n\n#### Call all the functions!\nThe library supports most of the MessageDB interactions listed [here](http://docs.eventide-project.org/user-guide/message-db/server-functions.html)\nOnce you have your connection, you can use the ```messageStore``` object to interact with your MessageDB.\n\n```JavaScript\nconnect(messageStoreConfig).then(async (messageStore) =\u003e {\n  const streamName = 'rickRoll-43cf527b-0fa1-433f-bad0-6834b927e243'\n\n  const event = {\n    id: '42b85f29-088e-4c53-8ba8-e2ffa9a239ea',\n    type: 'UserWasRickRolled',\n    data: {\n      neverGonna: [\n        'Give you up',\n        'Let you down',\n        'Turn around and forget you'\n      ]\n    },\n    metadata: {}\n  }\n\n  await messageStore.writeMessage(streamName, event)\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughtnerd%2Fmessage-store-connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoughtnerd%2Fmessage-store-connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoughtnerd%2Fmessage-store-connector/lists"}