Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
cloudflare-dns
Advanced tools
Readme
This was made with the intent of extending CloudFlare's Node.JS API with more functionality. Right now I'm only extending their DNS functionality in order to support updating existing records.
import CloudFlare from 'cloudflare-dns'
const cf = new CloudFlare({ token: 'my-token' })
Records may be expressed in different ways.
String
const record = 'example.com IN SSHFP 1 1 123456'
Object
const record = {
type: 'A',
name: 'example.com',
content: '127.0.0.1'
}
Object (with data, for complex records)
// example.com IN SSHFP 1 2 123456
const record = {
type: 'SSHFP',
name: 'example.com',
data: {
algorithm: 1,
type: 2,
content: '123456'
}
}
Creates a new record.
await cf.dns.create('my-zone', record)
Updates an existing record or creates a new one.
await cf.dns.update('my-zone', record)
Update is tricky: it will match existing records based on the name
and type
properties on most protocols. Some exceptions exist, though, where we'll need the content
and/or data
properties. See the following table to understand more.
Protocol | Content A | Content B | Match |
---|---|---|---|
SSHFP | 1 1 123456 | 1 1 654321 | yes |
SSHFP | 1 1 123456 | 1 2 654321 | no |
SSHFP | 1 1 123456 | 2 1 654321 | no |
FAQs
Extended CloudFlare API
The npm package cloudflare-dns receives a total of 7 weekly downloads. As such, cloudflare-dns popularity was classified as not popular.
We found that cloudflare-dns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.