Async Snippets
Sublime Text 2 package of snippets for node/async
Labels snippets
Details
Installs
- Total 2K
- Win 1K
- Mac 659
- Linux 411
Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text 2 Async-Snippets
This package contains Sublime Text 2 snippets to be used with the Async .js utility.
In order to use the snippets, enter the shortcode and press Tab (or whatever you have set as completion key).
Included are all snippets listed below. $1, $2, etc. show the position where the caret will appear whenever you press the tab key inside the snippet.
async_foreach
async.forEach(
${1:array},
function(item,callback){
${2:callback();}
},
function(err){
// if any of the saves produced an error, err would equal that error
if(err){
${3}
}else{
${4}
}
}
);
async_parallel
async.parallel({
${1:one}: function(callback){
${2://body}
},
${3:two}: function(callback){
${4://body}
},
},
function(err, ${5:results}) {
// results now equals: {one: 1, two: 2}
$6
});
async_series
async.series({
${1:one}: function(callback){
${2:callback(null,{})}
},
${3:two}: function(callback){
${4:callback(null,{})}
},
},
function(err, ${5:results}) {
// results is now equal to: {one: 1, two: 2}
${6}
});
async_waterfall
async.waterfall([
function(callback){
callback(null, ${1:'one'}, ${2:'two'});
},
function(${3:arg1}, ${4:arg2}, callback){
callback(null, ${5:'three'});
},
function(${6:arg1}, callback){
// arg1 now equals 'three'
callback(null, ${7:'done'});
}
], function (err, ${8:result}) {
// result now equals 'done'
});