{ "url": "<feedURL>" }
Description: Creates a feed from <feedUrl>
by making a HTTP request to the feed URL and saving it to the database.
This operation will fail if (in order):
/* jshint esnext: true */ | |
import * as di from 'di/src'; | |
class Car { | |
constructor(engine) { | |
console.log('Car constructor engine: %s', engine); | |
} | |
} | |
// TODO: Fix ES6 class annotations | |
// As per: https://github.com/angular/di.js/issues/80 |
/* jshint esnext: true */ | |
import * as di from 'di/src'; | |
class HttpAdapter { | |
constructor() { | |
console.log('HttpAdapter constructor'); | |
} | |
} | |
class ApiClient { |
npm install
node traceur-runner.js main.js
/** | |
* Given some nested data, what are the different options for logging in Node? | |
*/ | |
var a = [ | |
{ | |
"data": { | |
"url": "http://theguardian.com/", | |
"feeds": [ | |
{ |
Nodeify the result of a promise returning function.
When an API requires that you pass it a function with the signature (...args, cb)
, wrap is a small helper that allows you to instead pass a promise returning function. wrap will nodeify the result of the promise returning function (fulfilment or rejection) by passing its value to the original callback.
One such API that asks for an asynchronous listener function (...args, cb)
is express. When a HTTP request is made, express will call your listener function, if you have one registered for that route. The example below demonstrates how wrap can help you to use promises in such a situation.
export default 'bar'; |
npm install
node traceur-runner.js main.js
module.exports = 'bar'; |
/* jshint esnext: true */ | |
// `getStream` is some third party thing | |
var stream = getStream(); | |
var events = Rx.fromEvent(stream, 'meta'); | |
stream.write('foo'); | |
// meta event fired by `stream` | |
stream.write(null); |