https://github.com/codefeathers/do-node
A lightweight promise based Node wrapper around DigitalOcean's API v2
https://github.com/codefeathers/do-node
api digitalocean node-wrapper promise v2
Last synced: 9 months ago
JSON representation
A lightweight promise based Node wrapper around DigitalOcean's API v2
- Host: GitHub
- URL: https://github.com/codefeathers/do-node
- Owner: codefeathers
- License: mit
- Created: 2018-02-10T13:50:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-11T08:12:53.000Z (almost 8 years ago)
- Last Synced: 2025-03-29T20:34:37.657Z (10 months ago)
- Topics: api, digitalocean, node-wrapper, promise, v2
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# do-node
**A lightweight promise based Node wrapper for DigitalOcean API v2**
Currently do-node only supports domain and domain records functions.
## Installation
`npm install --save @codefeathers/do-node`
## Usage
- Get an API key from DigitalOcean.
- Add it to a `config.js` file in the same folder as your entry point like this:
```JavaScript
module.exports = {
token: '241f24ac97abe3321b0c972d97579ace4ae38c34a709169289c6474d58d8f',
}
```
- Import it in your file:
```JavaScript
const digitalOcean = require('do-node');
digitalOcean.domain.Create({
name: 'example.com',
ip: '1.2.3.4',
})
.then(res => console.log(res))
.catch(err => console.log(err.response.data.message));
digitalOcean.domain.Records.Update({
name: 'example.com',
}, 35459888)
.then(res => console.log(res))
.catch(err => console.log(err.response.data.message));
```