48 lines
2.3 KiB
Markdown
48 lines
2.3 KiB
Markdown
# cflare
|
|
easy cloudflare management
|
|
|
|
## Availabililty
|
|
[](https://www.npmjs.com/package/cflare)
|
|
[](https://GitLab.com/pushrocks/cflare)
|
|
[](https://github.com/pushrocks/cflare)
|
|
[](https://pushrocks.gitlab.io/cflare/)
|
|
|
|
## Status for master
|
|
[](https://GitLab.com/pushrocks/cflare/commits/master)
|
|
[](https://GitLab.com/pushrocks/cflare/commits/master)
|
|
[](https://www.npmjs.com/package/cflare)
|
|
[](https://david-dm.org/pushrocks/cflare)
|
|
[](https://www.bithound.io/github/pushrocks/cflare/master/dependencies/npm)
|
|
[](https://www.bithound.io/github/pushrocks/cflare)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
[](http://standardjs.com/)
|
|
|
|
## Usage
|
|
Use TypeScript for best in class instellisense.
|
|
|
|
```javascript
|
|
import * as cflare from 'cflare'
|
|
|
|
let myCflareAccount = new cflare.CflareAccount()
|
|
testCflareAccount.auth({
|
|
email: 'someuser@example.com',
|
|
key: 'someLongApiKey'
|
|
})
|
|
|
|
let myAsyncCflareManagement = async () => {
|
|
// get things
|
|
let myZones = await myCflareAccount.listZones() // zones are fully typed
|
|
let myIdForADomain = await myCflareAccount.getZoneId('example.com') // type number
|
|
let myRecordsForADomain = await myCflareAccount.listRecords('example.com') // records are fully typed
|
|
|
|
// set things
|
|
myCflareAccount.updateRecord(...)
|
|
myCflareAccount.createRecord(...)
|
|
myCflareAccount.deleteRecord(...)
|
|
}
|
|
|
|
```
|
|
|
|
[](https://push.rocks)
|