# node-cloudflare-dns

> Super simple way to manage Cloudflare DNS entries domainwise. No need to get into the hassle of Zone or DNS IDs.

Latest version **0.0.9** (published 2019-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-cloudflare-dns
pnpm add node-cloudflare-dns
yarn add node-cloudflare-dns
bun add node-cloudflare-dns
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-04-11 |
| First published | 2019-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 8.x |
| Dependencies | 4 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | rehmat |
| Keywords | node, cloudflare, dns, zone, entry, record |

## Links

- npm: https://www.npmjs.com/package/node-cloudflare-dns
- Repository: https://github.com/animatedcreativity.com/node-cloudflare-dns
- Homepage: https://github.com/animatedcreativity.com/node-cloudflare-dns#readme
- Issues: https://github.com/animatedcreativity.com/node-cloudflare-dns/issues
- npm.io page: https://npm.io/package/node-cloudflare-dns

## Dependencies (4)

- [request](https://npm.io/package/request.md) ^2.88.0
- [cloudflare](https://npm.io/package/cloudflare.md) ^2.5.1
- [node-file-config](https://npm.io/package/node-file-config.md) ^0.0.5
- [node-promise-wrapper](https://npm.io/package/node-promise-wrapper.md) ^0.0.2

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.0.9 (latest) — 2019-04-11
- 0.0.8 — 2019-03-21
- 0.0.7 — 2019-03-21
- 0.0.6 — 2019-03-21
- 0.0.5 — 2019-03-21
- 0.0.4 — 2019-03-18
- 0.0.3 — 2019-03-18
- 0.0.1 — 2019-03-18

## README

# node-cloudflare-dns

Super simple way to manage Cloudflare DNS entries domainwise. No need to get into the hassle of Zone or DNS IDs.  
Now supports Key-Value namespaces.

**Usage:**

```
var cloudflare = require("node-cloudflare-dns")({
  email: "email@domain.com",
  key: "<cloudflare_api_key>",
  account: "<account_id>" // can be taken from cloudflare account link, needed for Key-Value namespaces only.
});
var record = {type: "A", name: "test", content: "<ip_address>", proxied: true};
cloudflare.dns.add("domain.com", record);
```

For more information on DNS records, check: https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record

------------------------------------------------

**Methods:** (All methods return promise).

```
cloudflare.dns.list("domain.com");
```

- Lists all DNS records inside a domain.

```
cloudflare.dns.record("domain.com", "<subdomain>");
```

- Gets a DNS record for a subdomain, if there are multiple entries with same name will get the first one.

```
cloudflare.dns.add("domain.com", {type: "A", name: "test", content: "<ip_address>", proxied: true});
```

- Makes a new DNS entry.

```
cloudflare.dns.delete("domain.com", {type: "A", name: "test.domain.com"});
```

- Deletes existing DNS entry.
- WARNING: This is a very powerful delete and works on the basis of the query provided. For example: just `{type: "A"}` will remove all the `A` records for that domain. Please use more precise delete queries.

```
cloudflare.zones();
```

- Lists all the zones available under that Cloudflare account.

```
cloudflare.zone("domain.com");
```

- Get a particular domain's zone.

------------------------------------------

## key-Value Namespaces

```
cloudflare.kv.namespace.list();
```

- Get Key-value namespaces list.

```
cloudflare.kv.namespace.get(namespace);
```

- Get a Key-value namespace by name.

```
cloudflare.kv.get(namespace, key);
```

- Get a key's value from provided namespace.

```
cloudflare.kv.set(namespace, key, value);
```

- Set a key's value in provided namespace.

```
cloudflare.kv.delete(namespace, key);
```

- Delete a key from provided namespace.

---
_Source: https://npm.io/package/node-cloudflare-dns · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
