{"id":16483304,"url":"https://github.com/dipakparmar/rspamd-node-client","last_synced_at":"2025-07-26T02:38:02.841Z","repository":{"id":251557278,"uuid":"837741304","full_name":"dipakparmar/rspamd-node-client","owner":"dipakparmar","description":"A TypeScript Node.js client for Rspamd.","archived":false,"fork":false,"pushed_at":"2025-03-03T10:55:22.000Z","size":157,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T00:13:43.351Z","etag":null,"topics":["node-js","rspamd","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dipakparmar.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":"2024-08-03T22:12:15.000Z","updated_at":"2025-01-20T15:03:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"f29ca41b-e675-41e2-a2f7-fc4978b25890","html_url":"https://github.com/dipakparmar/rspamd-node-client","commit_stats":null,"previous_names":["dipakparmar/rspamd-node-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipakparmar%2Frspamd-node-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipakparmar%2Frspamd-node-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipakparmar%2Frspamd-node-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipakparmar%2Frspamd-node-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dipakparmar","download_url":"https://codeload.github.com/dipakparmar/rspamd-node-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244297868,"owners_count":20430347,"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":["node-js","rspamd","typescript"],"created_at":"2024-10-11T13:13:33.316Z","updated_at":"2025-03-23T12:32:24.789Z","avatar_url":"https://github.com/dipakparmar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @dipakparmar/rspamd-client\n\n[![NPM Version](https://img.shields.io/npm/v/%40dipakparmar%2Frspamd-client)](https://www.npmjs.com/package/@dipakparmar/rspamd-client)\n[![Downloads/week](https://img.shields.io/npm/dw/%40dipakparmar%2Frspamd-client?logo=npm\u0026label=npm%20downloads\u0026cacheSeconds=5)](https://www.npmjs.com/package/@dipakparmar/rspamd-client)\n[![License](https://img.shields.io/npm/l/%40dipakparmar%2Frspamd-client)](https://github.com/dipakparmar/rspamd-node-client/blob/main/LICENSE)\n\nA TypeScript Node.js client for Rspamd.\n\n\u003e **Note:** This package is currently in alpha and under active development. Use with caution in production environments.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\n```bash\npnpm add @dipakparmar/rspamd-client\n```\n\n## Usage\n\n```typescript\nimport { RspamdClient } from '@dipakparmar/rspamd-client';\n\nconst client = new RspamdClient({\n  host: 'localhost',\n  port: 11333,\n});\n\nconst rawEmail = fs.readFileSync('email.eml', 'utf8');\n\nasync function checkSpam() {\n  try {\n    const result = await client.check(rawEmail);\n    console.log('Check result:', result);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\ncheckSpam();\n```\n\n## API\n\n### `RspamdClient`\n\n#### Constructor\n\n```typescript\nnew RspamdClient(options?: Partial\u003cRspamdClientOptions\u003e)\n```\n\n##### Options\n\n- `host` (string): The Rspamd server host. Default: 'localhost'\n- `port` (number): The Rspamd server port. Default: 11333\n- `timeout` (number): Request timeout in milliseconds. Default: 5000\n- `https` (boolean): Use HTTPS for connections. Default: false\n- `debug` (boolean): Enable debug logging. Default: false\n\n#### Methods\n\n##### `check(message: string): Promise\u003cRspamdCheckV2Response\u003e`\n\nChecks a message for spam using Rspamd's `/checkv2` endpoint.\n\n## Roadmap\n\n| Feature                            | Status      |\n|------------------------------------|-------------|\n| Basic `/checkv2` functionality     | ✅ Completed |\n| Error handling and timeouts        | ✅ Completed |\n| Comprehensive testing              | 🚧 In Progress |\n| Support for all worker endpoints   | 🚧 In Progress |\n| Support for controller endpoints   | 📅 Planned  |\n| Improved documentation             | 📅 Planned  |\n| Performance optimizations          | 📅 Planned  |\n\nContributions are welcome! If you'd like to contribute to any of these features or have suggestions for new ones, please open an issue or submit a pull request.\n\n## Other Features and Endpoints\n\n### Normal Worker HTTP Endpoints\n\n- `/checkv2` (POST) - Checks message and returns action (Implemented)\n- `/ping` (GET) - Returns a pong HTTP reply (could be used for monitoring)\n\n### Controller HTTP Endpoints\n\n- `/fuzzyadd` (POST) - Adds message to fuzzy storage\n- `/fuzzydel` (POST) - Removes message from fuzzy storage\n- `/checkv2` (POST) - Checks message and returns action (same as normal worker)\n\nVarious GET endpoints are also available on the controller, including `/stat`, `/graph`, `/history`, `/actions`, `/maps`, and more. For a full list and details, please refer to the [Rspamd documentation](https://rspamd.com/doc/developers/protocol.html#controller-http-endpoints).\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/dipakparmar/rspamd-node-client/issues).\n\n## License\n\nThis project is [AGPL-3.0](https://github.com/dipakparmar/rspamd-node-client/blob/main/LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipakparmar%2Frspamd-node-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdipakparmar%2Frspamd-node-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipakparmar%2Frspamd-node-client/lists"}