Skip to content

@google-cloud/dns v0.3.0

Compare
Choose a tag to compare
@stephenplusplus stephenplusplus released this 17 Oct 22:28
· 22393 commits to main since this release

Updating

$ npm install @google-cloud/dns@0.3.0

⚠️ Breaking Changes

Promises have arrived!

Issue: #551
PR: #1705

It's been a long time coming, but we're finally here. We've shipped promise support in the Google Cloud DNS module!

Do I have to use promises?

Nope, carry on. (But keep reading if you use streams)

How do I use promises?

Don't pass a callback:

var dns = require('@google-cloud/dns')();

dns.getZones()
  .then(function(data) {
    var zones = data[0];
  })
  .catch(function(err) {});
How do I use a method as a stream?

All of the streaming functionality from our methods have been moved to their own method.

var dns = require('@google-cloud/dns')();

- dns.getZones()
+ dns.getZonesStream()
   .on('data', function(zone) {})
var zone = dns.zone('my-zone-name');

- zone.getChanges()
+ zone.getChangesStream()
   .on('data', function(change) {})

- zone.getRecords()
+ zone.getRecordsStream()
   .on('data', function(record) {})