{"id":19090756,"url":"https://github.com/kodedninja/datbot","last_synced_at":"2025-10-03T17:52:25.005Z","repository":{"id":143857899,"uuid":"185247306","full_name":"kodedninja/datbot","owner":"kodedninja","description":"Seed a DAT archive and trigger scripts on updates","archived":false,"fork":false,"pushed_at":"2019-05-06T18:09:54.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T22:30:14.913Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kodedninja.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-05-06T18:07:28.000Z","updated_at":"2019-05-22T20:59:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"a25d588e-964e-4dcf-9cb4-dee94c763c2d","html_url":"https://github.com/kodedninja/datbot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fdatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fdatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fdatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodedninja%2Fdatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodedninja","download_url":"https://codeload.github.com/kodedninja/datbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240138108,"owners_count":19753865,"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-09T03:08:54.880Z","updated_at":"2025-10-03T17:52:24.940Z","avatar_url":"https://github.com/kodedninja.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datbot\n\u003ca href=\"https://nodejs.org/api/documentation.html#documentation_stability_index\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square\" alt=\"Stability\"/\u003e\n\u003c/a\u003e\n\nSeed a DAT archive and trigger scripts on updates\n\n#### `Work In Progress`\n\n## Installation\n```\nnpm i datbot\n```\n\n## Usage\nUse it as a CLI tool or from a Node program using the API.\n\n```javascript\ndatbot('dat://dj837h....ew/', (path) =\u003e {\n  if (path.includes('content')) {\n    return [ 'npm run build' ]\n  }\n}, {\n  output: '~/.tmp/'\n})\n```\n\n## CLI\n```\n$  datbot \u003ckey\u003e [opts] [commands]\n\noptions\n  --help, -h              show this help text\n  --output, -o            tell datbot where to download the files\n  --verbose               print to the console\n  --version, -v           print version\n\nexample\n  $ datbot dat://dj837h....ew/ \"git add . \u0026\u0026 git commit -m automatic\"\n\n```\n\n## API\n### `datbot(key, reducer(path), ?options, ?callback(exitCodes))`\nTakes a Dat `key` that's forwarded to [`dat-node`](https://npmjs.com/package/dat-node) and a `reducer` function, that gets a `string` containing the path of the currently changed file and returns an `Array` of commands (`string`). The path here isn't reliable, when many files are changed at the same time.\n\nOptionally you can pass a `callback` function, that gets called after each update containing an `Array` of exit codes.\n\nDefaults of `options`:\n\n```javascript\n{\n  rate: 2500,      // miliseconds between update calls\n  output: \u003ckey\u003e    // output directory for the Dat archive\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Fdatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodedninja%2Fdatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodedninja%2Fdatbot/lists"}