A node.js wrapper around the Sunlight Foundation's Capital Words API that utilizes promises for easy chaining and asynchronous code.
npm install node-capitalwords
You will need a Sunlight Foundation API key to use the underlying API. This can be obtained here.
const CapitalWords = require('./capitalwords');
const capitalWords = new CapitalWords('yourAPIKey');
capitalWords.dates({ phrase: 'Sunlight Foundation' })
.then(function(response) {
console.log(response);
})
.catch(function(errorText) {
console.log('Error: ', errorText);
});
Check out the included examples.js for more examples
MIT