This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
@google-cloud/dns v0.3.0
⚠️ Breaking Changes
Promises have arrived!
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) {})