Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudflare

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudflare

CloudFlare API client

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
151K
increased by4.58%
Maintainers
1
Weekly downloads
 
Created
Source

Cloudflare Node.js bindings

Cloudflare v4 API bindings for Node.js, providing a sourdough "BREAD" (Browse, Read, Edit, Add, and Delete) interface.

With these bindings, you'll get the following features:

  • A Promise-based API. With modern versions of Node.js, this can be leveraged for async/await and generator support.
  • Effortless connections over HTTP/2.
  • Automatic handling of Gzip/Deflate compression.

Node.js v4 and greater are supported.

Configuration

Set your account email address and API key. The API key can be found on the My Account page in the Cloudflare dashboard.

var cf = require('cloudflare')({
  email: 'you@example.com',
  key: 'your Cloudflare API key'
});

API Overview

Every resource is accessed via your cf instance:

// cf.{ RESOURCE_NAME }.{ METHOD_NAME }

Every resource method returns a promise, which can be chained or used with async/await.

cf.zones.read('023e105f4ecef8ad9ca31a8372d0c353').then(function (resp) {
  return resp.result.status;
});


// where supported
async function getZoneStatus(id) {
  var resp = await cf.zones.read('023e105f4ecef8ad9ca31a8372d0c353');
  return resp.result.status;
}

Available resources and methods

  • dnsRecords
    • browse()
    • read(dnsRecordId)
    • edit(dnsRecordId, params)
    • add(params)
    • del(dnsRecordId)
  • ips
    • browse()
  • zones
    • browse()
    • read(zoneId)
    • edit(zoneId, params)
    • add(params)
    • del(zoneId)
    • activationCheck(zoneId)
    • purgeCache(zoneId, params)

Keywords

FAQs

Package last updated on 30 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc