# gcdns

> Programmatically create name records in Google Cloud DNS. https://cloud.google.com/dns/docs/quickstart

Latest version **0.0.6** (published 2022-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install gcdns
pnpm add gcdns
yarn add gcdns
bun add gcdns
```

## 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.6 |
| Published | 2022-01-19 |
| First published | 2019-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 (+26 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | pete reitz |
| Maintainers | petereitz |

## Links

- npm: https://www.npmjs.com/package/gcdns
- Repository: https://github.com/petereitz/gcdns
- Homepage: https://github.com/petereitz/gcdns#readme
- Issues: https://github.com/petereitz/gcdns/issues
- npm.io page: https://npm.io/package/gcdns

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1

## Recent versions

- 0.0.6 (latest) — 2022-01-19
- 0.0.5 — 2021-11-15
- 0.0.4 — 2019-07-23
- 0.0.3 — 2019-07-23
- 0.0.2 — 2019-07-23
- 0.0.1 — 2019-07-23

## README

# gcdns
Programmatically work with name records in Google Cloud DNS. 

## Overview
Given a service account keyfile and zone information, handles OAuth2 negotiation and proxies requests to the API.

## Install

```
npm -i gcdns
```

## Use

```javascript
const ZONE = require('gcdns');
const zone = new ZONE('/path-to/service-account/keyfile.json', 'example-com', 'example.com');

// pull an entire zone
zone.getRecords()
.then(result => console.log(result))
.catch(err => throw new Error(err))
```

## Creating Records

- `.createA("subDomain", "targetIP", ttl)` - Return a promise that resolves to the submitted change request.

```javascript
zone.createA('awesome', '1.2.3.4', 300)
.then(result => console.log(result))
.catch(err => throw new Error(err))
```

- `.createCNAME("subDomain", "targetDomain", ttl)` - Return a promise that resolves to the submitted change request.

```javascript
zone.createCNAME('alsoawesome', 'awesome.example.com', 300)
.then(result => console.log(result))
.catch(err => throw new Error(err))
```

## Querying Records

- `.getRecords()` - Return a promise that resolves to an array of all record objects in zone.

```javascript
zone.getRecords()
.then(result => console.log(result))
.catch(err => throw new Error(err));
``` 


## Changelog
- **v0.0.6** 
  - zone constructor and underlying auth constructor now take either a keyfile path or an object containing the same.
  - update axios to 0.25.0
- **v0.0.5** 
  - update axios to 0.24.0
- **v0.0.2-4** 
  - code and docu spruce up
- **v0.0.1**
  - initial

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