summaryrefslogtreecommitdiff
path: root/luasnip_snippets/javascript-node.json
blob: 975c69704f7210c0a4193d6f0864fb463e7e53ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
  "#!": {
    "prefix": "#!",
    "description": "#!/usr/bin/env node",
    "body": "#!/usr/bin/env node",
    "luasnip": {
      "priority": -50
    }
  },
  "ex": {
    "prefix": "ex",
    "description": "module.exports",
    "body": "module.exports = $1;"
  },
  "hcs": {
    "prefix": "hcs",
    "description": "http.createServer",
    "body": "http.createServer($1).listen($2);"
  },
  "ncs": {
    "prefix": "ncs",
    "description": "net.createServer",
    "body": [
      "net.createServer(function(${1:socket}){",
      "\t$1.on('data', function(${3:data}){",
      "\t\t$4",
      "\t\\});",
      "\t$1.on('end', function(){",
      "\t\t$5",
      "\t\\});",
      "\\}).listen(${6:8124});"
    ]
  },
  "pipe": {
    "prefix": "pipe",
    "description": "pipe",
    "body": "pipe(${1:stream})$2"
  },
  "eget": {
    "prefix": "eget",
    "description": "express GET",
    "body": "${1:app}.get('$2', $3);"
  },
  "epost": {
    "prefix": "epost",
    "description": "express POST",
    "body": "${1:app}.post('$2', $3);"
  },
  "eput": {
    "prefix": "eput",
    "description": "express PUT",
    "body": "${1:app}.put('$2', $3);"
  },
  "edelete": {
    "prefix": "edelete",
    "description": "express DELETE",
    "body": "${1:app}.delete('$2', $3);"
  },
  "stdout": {
    "prefix": "stdout",
    "description": "stdout",
    "body": "process.stdout"
  },
  "stdin": {
    "prefix": "stdin",
    "description": "stdin",
    "body": "process.stdin"
  },
  "stderr": {
    "prefix": "stderr",
    "description": "stderr",
    "body": "process.stderr"
  }
}