Created
October 2, 2015 19:11
-
-
Save FrankHassanabad/9e935d4e518ddc69f9c5 to your computer and use it in GitHub Desktop.
Stack ramblings
This file contains 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 characters
* Download Atom Editor and install it | |
* Go to packages to install a package and install | |
- git-plus | |
- last-cursor-position | |
- line-diff-details | |
- linter | |
- linter-eslint | |
- merge-conflicts | |
- preview | |
* Go to eslint to see how it works | |
- http://eslint.org/ | |
* Install NodeJS 4.0.0 | |
* Init a new project through | |
- node init | |
* Then install eslint through | |
- npm install --save-dev eslint | |
Now use Atom to create a few things like promises through say Q library | |
- npm install --save-dev Q | |
atom app.js and add something like this for play: | |
'use strict'; | |
const Q = require('q'); | |
function getInputPromise() { | |
return Q.fcall(function() { | |
return 10; | |
}); | |
} | |
getInputPromise().then(function(value) { | |
console.log('value 1 is: %s', value); | |
//throw new TypeError('Value 1 error'); | |
//return value * 2; | |
}) | |
.then(function(value) { | |
console.log('value 2 is %s', value); | |
//throw new TypeError('Value 2 error'); | |
//return value * 3; | |
}, function(failure){ | |
console.log('I have encountered a failure %s', failure); | |
}) | |
.fin(function() { | |
console.log ('fin from up top'); | |
}) | |
.done(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 17 should be npm init. Otherwise, nice preview of promises in Q. Thanks for the gist.