aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
committerKarel Kočí <cynerd@email.cz>2016-06-30 16:03:25 +0200
commite573b3020c032400eed60b649a2cbf55266e6bb0 (patch)
tree8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
parentb8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff)
downloadmyconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2
myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets')
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets65
1 files changed, 65 insertions, 0 deletions
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
new file mode 100644
index 0000000..7a14dee
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
@@ -0,0 +1,65 @@
+priority -50
+
+snippet #! "shebang"
+#!/usr/bin/env node
+endsnippet
+
+snippet vreq "assign a CommonJS-style module to a var"
+var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('${1}');
+endsnippet
+
+snippet ex "module.exports"
+module.exports = ${1};
+endsnippet
+
+snippet hcs "http.createServer"
+http.createServer(${1}).listen(${2});
+endsnippet
+
+snippet ncs "net.createServer"
+net.createServer(function(${1:socket}){
+ ${1}.on('data', function(${3:data}){
+ ${4}
+ });
+ ${1}.on('end', function(){
+ ${5}
+ });
+}).listen(${6:8124});
+endsnippet
+
+snippet pipe "pipe"
+pipe(${1:stream})${2}
+endsnippet
+
+# Express snippets
+
+snippet eget "express GET"
+${1:app}.get('${2}', ${3});
+endsnippet
+
+snippet epost "express POST"
+${1:app}.post('${2}', ${3});
+endsnippet
+
+snippet eput "express PUT"
+${1:app}.put('${2}', ${3});
+endsnippet
+
+snippet edelete "express DELETE"
+${1:app}.delete('${2}', ${3});
+endsnippet
+
+# process snippets
+
+snippet stdout "stdout"
+process.stdout
+endsnippet
+
+snippet stdin "stdin"
+process.stdin
+endsnippet
+
+snippet stderr "stderr"
+process.stderr
+endsnippet
+