{"id":23379085,"url":"https://github.com/colevoss/gnatty","last_synced_at":"2026-05-07T10:33:55.476Z","repository":{"id":38617131,"uuid":"243438687","full_name":"colevoss/gnatty","owner":"colevoss","description":"Node.js TypeScript framework easily building API's and backends using the NATS network messaging protocol","archived":false,"fork":false,"pushed_at":"2023-01-06T02:35:42.000Z","size":725,"stargazers_count":1,"open_issues_count":24,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T11:36:37.373Z","etag":null,"topics":["boilerplate","javascript","lerna","microservices","nats","nats-client","nats-messaging","nodejs","typescript"],"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/colevoss.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":"2020-02-27T05:28:30.000Z","updated_at":"2023-03-10T08:36:05.000Z","dependencies_parsed_at":"2023-02-05T03:16:42.395Z","dependency_job_id":null,"html_url":"https://github.com/colevoss/gnatty","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":"colevoss/lerna-typescript-boilerplate","purl":"pkg:github/colevoss/gnatty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fgnatty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fgnatty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fgnatty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fgnatty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colevoss","download_url":"https://codeload.github.com/colevoss/gnatty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colevoss%2Fgnatty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32733635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["boilerplate","javascript","lerna","microservices","nats","nats-client","nats-messaging","nodejs","typescript"],"created_at":"2024-12-21T19:16:35.342Z","updated_at":"2026-05-07T10:33:55.460Z","avatar_url":"https://github.com/colevoss.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gnatty\n\nGnatty is a collection of packages for building backend Node.js/TypeScript API's\nusing the [NATS](https://nats.io/) messaging system. It is geared for building\nmicroservices that communicate over NATS using a request/reply or a pub/sub message\npatterns.\n\n## Packages\n\n- [@gnatty/core](/packages/core)\n- [@gnatty/gateway](/packages/gateway)\n\n## Installation\n\n### Existing TypeScript Node Project\n\n```\nnpm install @gnatty/core @gnatty/gateway\n```\n\n### New Project\n\nCreate a new TypeScript Node project by using the [this](https://github.com/colevoss/typescript-node-boilerplate)\ntemplate repo to create your new project. Then clone the new repo and install `@gnatty/core` (and `@gnatty/gateway`\nif necessary) to start your project.\n\n## Example\n\n```ts\nimport { Server, Service, Context, Action, Subscribe } from '@gnatty/core';\nimport { Gateway } from '@gatty/gateway';\n\nclass ExampleServer extends Server {}\n\nclass ExampleService extends Service\u003cExampleServer\u003e {\n  public name = 'example';\n\n  @Action('action')\n  public async exampleAction(ctx: Context\u003c{ foo: string }\u003e) {\n    const { foo } = ctx.data;\n\n    this.logger.info({ foo }, 'example.action was requested');\n\n    ctx.send({ example: 'response' });\n  }\n\n  @Subscribe('testSubscription')\n  public async testSubscription(ctx: Context\u003c{ bar: string }\u003e) {\n    this.logger.info({ bar }, 'testSubscription event was published');\n  }\n}\n\nconst server = ExampleServer.create({\n  json: true,\n  url: 'nats://localhost:4222',\n  user: 'ruser',\n  pass: 'T0pS3cr3t',\n});\n\nconst gateway = new Gateway();\n\nconst start = async () =\u003e {\n  await server.start([ExampleService]);\n  await gateway.start();\n};\n\nstart();\n```\n\nThe example above creates a gnatty server and registers the `ExampleService`. The\nexample service creates the `example.action` subject. Any NATS request to the `example.action`\nsubject with the parameters of `{ foo: string }` will respond with `{ example: 'response' }`\nwhile also logging a message.\n\nThe `ExampleService` also subscribes to the `testSubscription` subject. When an event\nis published to the `testSubscription` subject, it will be handled by this method.\n\nThe example also uses the `@gnatty/gateway` package. This will create an HTTP server\nthat will forward requests to the correct action based on the requested route and the\nservice's name and action.\n\nFor the example above, making a `POST` request to `locahost:8080/example/action` will\nhit the gateway, parse the route to `example.action` and forward the request through\nNATS to the `example.action` action in the `ExampleService`.\n\n_**Note:** the example above assumes a nats server is running at nats://localhost:4222. An easy way to achieve\nthis is by running the [NATS docker image](https://hub.docker.com/_/nats) locally_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolevoss%2Fgnatty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolevoss%2Fgnatty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolevoss%2Fgnatty/lists"}