npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

clouddns

v0.0.1

Published

A client implementation for Rackspace Cloud DNS in node.js

Readme

node-clouddns

An incomplete fork of nodejitsu's node-cloudfiles, ripped apart and refitted for Rackspace Cloud DNS API. WARNING: This could very well break your rackspace account, I am not responsible. Don't say I didn't warn you.

Installation

This module is not yet available via npm. (Comming soon)

Getting Rackspace Account

Usage

The node-clouddns library is compliant with the Rackspace clouddns API. Using node-clouddns is easy for a variety of scenarios: authenticating, creating and working with both domains and DNS records.

Getting Started

Before we can do anything with clouddns, we have to create a client with valid credentials. clouddns will authenticate for you automatically:

  var clouddns = require('clouddns');
  var config = {
    auth : {
      username: 'your-username',
      apiKey: 'your-api-key'
    }
  };
  
  var client = clouddns.createClient(config);

Working with the client

  // Authenticate
  client.setAuth(function () {
  
  // Listing domains for your account
    client.getDomains(function (err, domainArray) {
      	console.dir(domainArray);
    });
    
  // Creating a new domain
    var newDomain = {
  	  "name" : "example.com",
      "comment" : "Optional domain comment...",
      "ttl" : 3600,
      "emailAddress" : "[email protected]"
    };
    
    client.createDomain(newDomain, function(err, domainArray){
      console.dir(domainArray);
    });
    
    // Search by name or page through a long list
    var searchOpts = {limit: 3, offset: 9, name: "mydomainsearchstring" };
    
    client.getDomains(searchOpts, function (err, domainArray) {
      	console.dir(domainArray);
    });
    
  });

Working with the domains

All the expected CRUD methods that you would expect are available to the domain object We also have the ability to import and export BIND9 db files, check out the tests for more details

  // Authenticate
  client.setAuth(function () {
  
  // Listing domains for your account
    client.getDomains(function (err, domainArray) {
    	
      // All domains returned are wrapped with our helper objects
      domainArray[0].getDetails(function(err, domain) {
      	//Domains returned from the client.getDomais() function are bare lists, 
      	//  so we call getDetails() to also get the subdomains and domain records
      	console.dir(domain.recordsList);
      }
      
      //Helper methods call getDetails() automatically on the domain first if the records are not cached
      
      domainArray[0].getSubDomains(function(err, domain) {
      	console.dir(domain.subdomains.domains);
      	
      	//Subdomains are still domains, so all the same methods apply so:
      	domain.subdomains.domains[0].comment = "I'm updating this subdomain";
      	domain.subdomains.domains[0].updateDomain(function(err, domain){
      	//Still the parent domain
      		console.dir(domain);
      	});
      	
      	//Or pass bare object, we're crazy like that
      	domain.subdomains.domains[0].updateDomain({comment: "My fav domain", ... }function(err, domain){
      		console.dir(domain);
      	});
      	
      	//Change history for the domain, pass in an optional Date() to limit the "since" time
      	domain.getChanges(function(err, changes){
      		console.dir(changes);
      	});
      	
      	
      	//Delete the domain
      	domain.removeDomain(function(err){
      	  if (err) {
      	  	console.log("Whoops can't delete" + err);
      	  }
      	});
      
      }); 
      
    });
    
  });

Working with domain records

Updating and deleting can be done directly on the record objects, and bulk updates are done via the domain Again you should really run and read the tests, for more info

  // Authenticate
  client.setAuth(function () {
  
  // Listing domains for your account
    client.getDomains(function (err, domainArray) {
    	
      // Get the records
      domainArray[0].getRecords(function(err, records) {
      
      	//Add a comment
        records[0].comment = "Bad MX record, I should just delete it";
      	records[0].updateRecord(function(){
      		if (!err) console.log("success");
      		
      		// Aww, just delete it already
      		records[0].removeRecord(function(){
	      		if (!err) console.log("success");
	      	});
      	});
      	
      	
      });
      
      // Bulk record update, first parameter could be a Record Instance, or Array of records
      // Note all bulk updating functions can take either our Domain or Record instances, or just simple objects and arrays
      domainArray[1].addRecords( recordArray, function(err, domain) {
        console.dir(domain);
      });  
      
      
    });
    
  });

Authentication Service

Use the 'host' key in the auth configuration to specify the url to use for authentication:

  var clouddns = require('clouddns');
  var config = {
    auth : {
      username: 'your-username',
      apiKey: 'your-api-key',
      host : "lon.auth.api.rackspacecloud.com"
    }
  };

  var client = clouddns.createClient(config);

Run Tests

All of the node-clouddns tests are written in vows, and cover all of the use cases described above. You will need to add your Rackspace API username and API key to test/fixtures/test-config.json before running tests:

  {
    "auth": {
      "username": "your-username",
      "apiKey": "your-apikey"
    }
  }

Once you have valid Rackspace credentials you can run tests with npm and vows:

  npm test

Credits

Author: Andrew Cope

Contributors: [This space available for purchase, cost 3 easy payments of pull requests :-) ]

Based on the node-cloudfiles library by the following

Author: Charlie Robbins

Contributors: Fedor Indutny, aaronds