mailerlite
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -52,2 +52,10 @@ 'use strict'; | ||
/* Get all active subscribers from a given list. */ | ||
function activeSubscribers (id, callback) { | ||
validateRequest(config, callback); | ||
var uri = config.endpoint + 'lists/' + id + '/active/'; | ||
executeGetRequest(uri, callback); | ||
} | ||
/* Export the lists module. */ | ||
@@ -59,4 +67,5 @@ module.exports = function Lists (externalConfig) { | ||
getAllLists: getAllLists, | ||
listDetails: listDetails | ||
listDetails: listDetails, | ||
activeSubscribers: activeSubscribers | ||
}; | ||
}; |
{ | ||
"name": "mailerlite", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Node.js wrapper for MailerLite API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# MailerLite SDK for Node.js | ||
[![NPM package][nodei-image]][nodei-url] | ||
[![NPM version][npm-image]][npm-url] | ||
Node.js wrapper for MailerLite API. | ||
@@ -10,2 +15,8 @@ | ||
Please note this is still a work in progress. | ||
Please note this is still a work in progress. | ||
[nodei-url]: https://nodei.co/npm/mailerlite/ | ||
[nodei-image]: https://nodei.co/npm/mailerlite.png?mini=true | ||
[npm-url]: https://npmjs.org/package/mailerlite | ||
[npm-image]: http://img.shields.io/npm/v/mailerlite.svg?style=flat-square |
@@ -12,2 +12,15 @@ 'use strict'; | ||
/* Get active subscribers from a given list. */ | ||
function test_activeSubscribers (id) { | ||
console.info('== activeSubscribers =========='); | ||
ML.Lists.activeSubscribers(id, function (err, data) { | ||
if (err) { | ||
throw err; | ||
} | ||
/* Print active subscribers. */ | ||
console.log(data); | ||
}); | ||
} | ||
/* Get details from a given list. */ | ||
@@ -23,2 +36,5 @@ function test_listDetails (id) { | ||
console.log(data); | ||
/* Get active subscribers from this list. */ | ||
test_activeSubscribers(id); | ||
}); | ||
@@ -25,0 +41,0 @@ } |
6458
120
22