Created
September 8, 2015 10:29
-
-
Save andre487/e637a8024a29afa2e36c to your computer and use it in GitHub Desktop.
Revisions
-
andre487 created this gist
Sep 8, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ var Fs = require('fs'); var Http = require('q-io/http'); var Q = require('q'); var R = require('ramda'); var readFile = R.composeP(R.toString, R.partial(Q.ninvoke, Fs, 'readFile')); var readPackageInfo = R.composeP(JSON.parse, readFile, R.partial(Q, 'package.json')); var homePageFromAuthor = R.compose(R.propOr('', 1), R.match(/.+?\((.+?)\)$/), R.prop('author')); var getHomePageHtml = R.composeP(R.toString, Http.read, homePageFromAuthor, readPackageInfo); getHomePageHtml() .then(R.bind(console.log, console));