{"id":24976761,"url":"https://github.com/steffenkn/cloudflare-ddns-sync","last_synced_at":"2025-04-11T14:13:09.882Z","repository":{"id":57200738,"uuid":"126445551","full_name":"SteffenKn/cloudflare-ddns-sync","owner":"SteffenKn","description":"A simple package to update DNS records on Cloudflare whenever you want.","archived":false,"fork":false,"pushed_at":"2024-04-15T18:48:58.000Z","size":2482,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-07T15:53:29.576Z","etag":null,"topics":["cloudflare","cloudflare-ddns-sync","cloudflare-dns-records","ddns","dns","javascript","nodejs","sync","typescript"],"latest_commit_sha":null,"homepage":"https://cddnss.knaup.pw/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SteffenKn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-03-23T06:58:19.000Z","updated_at":"2024-11-26T07:55:34.000Z","dependencies_parsed_at":"2024-01-08T13:37:14.463Z","dependency_job_id":"c1b2a624-2de7-4262-bde8-48d9f343730a","html_url":"https://github.com/SteffenKn/cloudflare-ddns-sync","commit_stats":null,"previous_names":["steffen982/cloudflare-ddns-sync"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteffenKn%2Fcloudflare-ddns-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteffenKn%2Fcloudflare-ddns-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteffenKn%2Fcloudflare-ddns-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteffenKn%2Fcloudflare-ddns-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SteffenKn","download_url":"https://codeload.github.com/SteffenKn/cloudflare-ddns-sync/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248414990,"owners_count":21099585,"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":["cloudflare","cloudflare-ddns-sync","cloudflare-dns-records","ddns","dns","javascript","nodejs","sync","typescript"],"created_at":"2025-02-03T22:54:20.026Z","updated_at":"2025-04-11T14:13:09.862Z","avatar_url":"https://github.com/SteffenKn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"25%\"\u003e\u003cimg src=\"./logo.png\" alt=\"Logo\" width=\"100%\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ch1\u003eCloudflare DDNS Sync\u003c/h1\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n![](https://github.com/SteffenKn/cloudflare-ddns-sync/actions/workflows/push.yml/badge.svg)\n[![npm version](https://badge.fury.io/js/cloudflare-ddns-sync.svg)](https://www.npmjs.com/package/cloudflare-ddns-sync)\n[![Downloads](https://img.shields.io/npm/dm/cloudflare-ddns-sync.svg)](https://www.npmjs.com/package/cloudflare-ddns-sync)\n[![CLI](https://img.shields.io/badge/CLI-npm-important.svg)](https://www.npmjs.com/package/cloudflare-ddns-sync-cli)\n\n## Overview\n\nCloudflare-DDNS-Sync is a simple module that updates Cloudflare DNS records.\n\nFor a more detailed overview, have a look at the [Documentation](https://cddnss.knaup.pw/)\n\nYou may also have a look at the **official** [CLI version](https://www.npmjs.com/package/cloudflare-ddns-sync-cli) of Cloudflare-DDNS-Sync.\n\n## How do I set this project up?\n\n### Prerequisites\n\n- Node\n- Cloudflare Account\n\n### Installation\n\nTo install Cloudflare-DDNS-Sync simply run:\n\n```\nnpm install cloudflare-ddns-sync\n```\n\nin your project folder.\n\n## Usage\n\n\u003e Hint: If a record is not existing, CDS will automatically create it when\n\u003e syncing.\n\n### Javascript Example\n\n```javascript\nconst Cddnss = require('cloudflare-ddns-sync').default;\n\n// either email and key or token\nconst cddnss = new Cddnss({\n  email: 'your@email.com',\n  key: '\u003cyour-cloudflare-api-key\u003e',\n  token: '\u003cyour-cloudflare-api-token\u003e',\n});\n\nconst records = [\n  {\n    name: 'test-1.domain.com',\n    type: 'A', // optional\n    proxied: true, // optional\n    ttl: 1, // optional\n    priority: 0, // optional\n    content: '1.2.3.4', // optional\n  },\n  {\n    name: 'test-2.domain.com',\n  },\n];\n\ncddnss.syncRecords(records).then((result) =\u003e {\n  console.log(result);\n});\n```\n\n### Typescript Example\n\n```typescript\nimport Cddnss, {Record, RecordData} from 'cloudflare-ddns-sync';\n\n// either email and key or token\nconst cddnss = new Cddnss({\n  email: 'your@email.com',\n  key: '\u003cyour-cloudflare-api-key\u003e',\n  token: '\u003cyour-cloudflare-api-token\u003e',\n});\n\nconst records: Array\u003cRecord\u003e = [\n  {\n    name: 'test-1.yourdomain.com',\n    type: 'A', // optional\n    proxied: true, // optional\n    ttl: 1, // optional\n    priority: 0, // optional\n    content: '1.2.3.4', // optional\n  },\n  {\n    name: 'test-2.yourdomain.com',\n  },\n];\n\ncddnss.syncRecords(records).then((result: Array\u003cRecordData\u003e) =\u003e {\n  console.log(result);\n});\n```\n\n### Cron Expression Syntax\n\nCron expressions have the following syntax:\n\n```\n* * * * * *\n┬ ┬ ┬ ┬ ┬ ┬\n│ │ │ │ │ │\n│ │ │ │ │ └──── weekday (0-7, sunday is 0 or 7)\n│ │ │ │ └────── month (1-12)\n│ │ │ └──────── day (1-31)\n│ │ └────────── hour (0-23)\n│ └──────────── minute (0-59)\n└────────────── second (0-59) [optional]\n```\n\n## Methods\n\n- getIp(): Promise\\\u003cstring\\\u003e\n- getIpv6(): Promise\\\u003cstring\\\u003e\n- getRecordDataForDomain(domain: string): Promise\\\u003cArray\\\u003c[RecordData](https://cddnss.knaup.pw/types/recorddata)\\\u003e\\\u003e\n- getRecordDataForDomains(domains: Array\\\u003cstring\\\u003e): Promise\\\u003c[DomainRecordList](https://cddnss.knaup.pw/types/domainrecordlist)\\\u003e\n- getRecordDataForRecord(record: [Record](https://cddnss.knaup.pw/types/record)): Promise\\\u003c[RecordData](https://cddnss.knaup.pw/types/recorddata)\\\u003e\n- getRecordDataForRecords(records: Array\\\u003c[Record](https://cddnss.knaup.pw/types/record)\\\u003e): Promise\\\u003cArray\\\u003c[RecordData](https://cddnss.knaup.pw/types/recorddata)\\\u003e\\\u003e\n- removeRecord(recordName: string, recordType?: string): Promise\\\u003cvoid\\\u003e\n- stopSyncOnIpChange(changeListenerId: string): void\n- syncByCronTime(cronExpression: string, records: Array\\\u003c[Record](https://cddnss.knaup.pw/types/recorddata)\\\u003e, callback: [MultiSyncCallback](https://cddnss.knaup.pw/types/multisynccallback), ip?: string): [ScheduledTask](https://www.npmjs.com/package/node-cron#scheduledtask-methods)\n- syncOnIpChange(records: Array\\\u003c[Record](https://cddnss.knaup.pw/types/record)\\\u003e, callback: multisynccallback): Promise\\\u003cstring\\\u003e\n- syncRecord(record: [Record](https://cddnss.knaup.pw/types/record), ip?: string): Promise\\\u003c[RecordData](https://cddnss.knaup.pw/types/recorddata)\\\u003e\n- syncRecords(records: Array\\\u003c[Record](https://cddnss.knaup.pw/types/record)\\\u003e, ip?: string): Promise\\\u003cArray\\\u003c[RecordData](https://cddnss.knaup.pw/types/recorddata)\\\u003e\\\u003e\n\nFor a more detailed view, have a look at the [Documentation](https://cddnss.knaup.pw/)\n\n## Get Your Cloudflare API Key\n\n- Go to **[Cloudflare](https://www.cloudflare.com)**\n- **Log In**\n- In the upper right corner: **click on the user icon**\n- Go to **\"My Profile\"**\n- In the \"API Tokens\"-Section: **click on the \"View\"-Button of the Global Key**\n- **Enter your password** and **fill the captcha**\n- **Copy the API Key**\n\n## Tests\n\nIn order to run the tests there are two ways to do so\n\n### Use `test-data.json`\n\n- Open the `test-data.json` which can be found under `src/tests/test-service/`\n- Configure the email, cloudflare api key and the domain\n- Run `npm test`\n\n### Use `npm test` Only\n\n- Run `npm test -- --email=\"your@email.com\" --key=\"your_cloudflare_api_key\" --domain=\"yourdomain.com\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffenkn%2Fcloudflare-ddns-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteffenkn%2Fcloudflare-ddns-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffenkn%2Fcloudflare-ddns-sync/lists"}