Skip to content

Commit afce863

Browse files
committed
simplify nexttick to nt
1 parent 80487aa commit afce863

File tree

2 files changed

+80
-80
lines changed

2 files changed

+80
-80
lines changed

README.md

+79-79
Original file line numberDiff line numberDiff line change
@@ -32,136 +32,136 @@ Install from VSCode Extension Marketplace [Hyper JavaScript Snippets](https://ma
3232
### Declarations
3333
| Prefix | Desc | Body |
3434
| -----: | --------------------------------------- | ----------------------- |
35-
| `va` | var assignment | `var ${1} = ${0}` |
36-
| `la` | let assignment (ES2015) | `let ${1} = ${0}` |
37-
| `ca` | const assignment (ES2015) | `const ${1} = ${0}` |
38-
| `vad` | var destructuring assignment (ES2015) | `var ${2} = ${1}${0}` |
39-
| `lad` | let destructuring assignment (ES2015) | `let ${2} = ${1}${0}` |
40-
| `cad` | const destructuring assignment (ES2015) | `const ${2} = ${1}${0}` |
35+
| `va` | var assignment | `var ${1} = ${0}` |
36+
| `la` | let assignment (ES2015) | `let ${1} = ${0}` |
37+
| `ca` | const assignment (ES2015) | `const ${1} = ${0}` |
38+
| `vad` | var destructuring assignment (ES2015) | `var ${2} = ${1}${0}` |
39+
| `lad` | let destructuring assignment (ES2015) | `let ${2} = ${1}${0}` |
40+
| `cad` | const destructuring assignment (ES2015) | `const ${2} = ${1}${0}` |
4141

4242
### Conditional
43-
| Prefix | Desc | Body |
43+
| Prefix | Desc | Body |
4444
| -------: | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
45-
| `if` | if statement | `if (${1}) {${0}}` |
46-
| `else` | else statement | `else {${0}}` |
47-
| `ifel` | if/else statement | `if (${1}) {${2}} else {${0}}` |
48-
| `elif` | else if statement | `else if (${1}) {${0}}` |
49-
| `ter` | ternary operator | `${1} ? ${2} : ${0}` |
45+
| `if` | if statement | `if (${1}) {${0}}` |
46+
| `else` | else statement | `else {${0}}` |
47+
| `ifel` | if/else statement | `if (${1}) {${2}} else {${0}}` |
48+
| `elif` | else if statement | `else if (${1}) {${0}}` |
49+
| `ter` | ternary operator | `${1} ? ${2} : ${0}` |
5050
| `switch` | switch case | <code>switch (${1}) {<br>&nbsp;&nbsp;case ${2} :<br>&nbsp;&nbsp;&nbsp;&nbsp;$0<br>&nbsp;&nbsp;default:<br>&nbsp;&nbsp;&nbsp;&nbsp;break;<br>}</code> |
51-
| `case` | switch's case | <code>case ${1} :<br>&nbsp;&nbsp;${0}</code> |
51+
| `case` | switch's case | <code>case ${1} :<br>&nbsp;&nbsp;${0}</code> |
5252

5353
### Iteration
54-
| Prefix | Desc | Body |
55-
| -------: | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
56-
| `for` | for loop | <code>for (${1} ; ${2} ; ${3}) {<br>&nbsp;&nbsp;${0}<br>}</code> |
57-
| `forin` | for in loop | <code>for (const ${1} in ${2}) {<br>&nbsp;&nbsp;if (${2}.hasOwnProperty(${1})) {<br>&nbsp;&nbsp;&nbsp;&nbsp;${0}<br>&nbsp;&nbsp;}<br>}</code> |
58-
| `forof` | for of loop (ES2015) | <code>for (const ${1} of ${2}) {<br>&nbsp;&nbsp;${0}<br>}</code> |
59-
| `while` | while loop | `while (${1}) {${0}}` |
60-
| `tc` | try/catch | `try {${0}} catch (error) {${1}}` |
61-
| `tryfin` | try/finally | `try {${0}} finally {${1}}` |
62-
| `tcf` | try/catch/finally | `try {${0}} catch (error) {${1}} finally {${2}}` |
54+
| Prefix | Desc | Body |
55+
| ------: | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
56+
| `for` | for loop | <code>for (${1} ; ${2} ; ${3}) {<br>&nbsp;&nbsp;${0}<br>}</code> |
57+
| `forin` | for in loop | <code>for (const ${1} in ${2}) {<br>&nbsp;&nbsp;if (${2}.hasOwnProperty(${1})) {<br>&nbsp;&nbsp;&nbsp;&nbsp;${0}<br>&nbsp;&nbsp;}<br>}</code> |
58+
| `forof` | for of loop (ES2015) | <code>for (const ${1} of ${2}) {<br>&nbsp;&nbsp;${0}<br>}</code> |
59+
| `while` | while loop | `while (${1}) {${0}}` |
60+
| `tc` | try/catch | `try {${0}} catch (error) {${1}}` |
61+
| `tf` | try/finally | `try {${0}} finally {${1}}` |
62+
| `tcf` | try/catch/finally | `try {${0}} catch (error) {${1}} finally {${2}}` |
6363

6464
### Functions
65-
| Prefix | Desc | Body |
66-
| -----: | ---------------------------------------------- | -------------------------------------- |
67-
| `f` | anonymous function | `function(${1}) {${0}}` |
68-
| `fn` | named function | `function ${1}(${2}) {${0}}` |
69-
| `fa` | async anonymous function | `async function (${1}) {${0}}` |
70-
| `fna` | async named function | `async function ${1}(${2}) {${0}}` |
71-
| `af` | arrow function (ES2015) | `(${1}) => ${0}` |
72-
| `afa` | async arrow function (ES2015) | `async (${1}) => ${0}` |
73-
| `iife` | immediately-invoked function expression (IIFE) | `(${2})(${1})${0}` |
74-
| `gf` | anonymous generator function (ES2015) | `function* (${1}) {${0}}` |
75-
| `gfa` | async generator function (ES2018) | `async function* (${1}) {${0}}` |
76-
| `gfn` | named generator function (ES2015) | `function* ${1}(${2}) {${0}}` |
77-
| `gfna` | async named generator function (ES2018) | `async function* ${1}(${2}) {${0}}` |
65+
| Prefix | Desc | Body |
66+
| -----: | ---------------------------------------------- | ----------------------------------- |
67+
| `f` | anonymous function | `function(${1}) {${0}}` |
68+
| `fn` | named function | `function ${1}(${2}) {${0}}` |
69+
| `fa` | async anonymous function | `async function (${1}) {${0}}` |
70+
| `fna` | async named function | `async function ${1}(${2}) {${0}}` |
71+
| `af` | arrow function (ES2015) | `(${1}) => ${0}` |
72+
| `afa` | async arrow function (ES2015) | `async (${1}) => ${0}` |
73+
| `iife` | immediately-invoked function expression (IIFE) | `(${2})(${1})${0}` |
74+
| `gf` | anonymous generator function (ES2015) | `function* (${1}) {${0}}` |
75+
| `gfa` | async generator function (ES2018) | `async function* (${1}) {${0}}` |
76+
| `gfn` | named generator function (ES2015) | `function* ${1}(${2}) {${0}}` |
77+
| `gfna` | async named generator function (ES2018) | `async function* ${1}(${2}) {${0}}` |
7878

7979
### Iterables
8080
| Prefix | Desc | Body |
8181
| -----: | ---------------- | ------------------------------------ |
82-
| `seq` | sequence of 0..n | `[...Array(${1:length}).keys()]${0}` |
82+
| `seq` | sequence of 0..n | `[...Array(${1:length}).keys()]${0}` |
8383

8484
### Objects
85-
| Prefix | Desc | Body |
86-
| -----: | -------------- | ----------------- |
87-
| `ol` | object literal | `{ ${1}: ${0} }` |
85+
| Prefix | Desc | Body |
86+
| -----: | -------------- | ---------------- |
87+
| `ol` | object literal | `{ ${1}: ${0} }` |
8888

8989
### Classes
9090
| Prefix | Desc | Body |
9191
| -----: | -------------------------- | ------------------------------------------------------------------------------- |
92-
| `cs` | class (ES2015) | <code>class ${1:name} {<br>&nbsp;&nbsp;${0}<br>}</code> |
93-
| `cse` | class extends (ES2015) | <code>class ${1:name} extends ${2:base} {<br>&nbsp;&nbsp;${0}<br>}</code> |
92+
| `cs` | class (ES2015) | <code>class ${1:name} {<br>&nbsp;&nbsp;${0}<br>}</code> |
93+
| `cse` | class extends (ES2015) | <code>class ${1:name} extends ${2:base} {<br>&nbsp;&nbsp;${0}<br>}</code> |
9494
| `ctor` | class constructor (ES2015) | `constructor(${1}) {${0}}` |
95-
| `csm` | method (ES2015) | `${1:name}(${2}) {${0}}` |
95+
| `csm` | method (ES2015) | `${1:name}(${2}) {${0}}` |
9696
| `csma` | async method (ES2015) | `async ${1:name}(${2}) {${0}}` |
9797
| `gter` | getter (ES2015) | `get ${1:property}() {${0}}` |
9898
| `ster` | setter (ES2015) | `set ${1:property}(${2:value}) {${0}}` |
99-
| `gs` | getter and setter (ES2015) | <code>get ${1:property}() {${0}}<br><br>set ${1:property}(${2:value}) {}</code> |
99+
| `gs` | getter and setter (ES2015) | <code>get ${1:property}() {${0}}<br><br>set ${1:property}(${2:value}) {}</code> |
100100

101101
### Types
102102
| Prefix | Desc | Body |
103103
| -----: | ---------- | ------------------------------------ |
104-
| `tof` | typeof | `typeof ${1:source} === '${0:type}'` |
105-
| `iof` | instanceof | `${1:source} instanceof ${0:Class}` |
104+
| `tof` | typeof | `typeof ${1:source} === '${0:type}'` |
105+
| `iof` | instanceof | `${1:source} instanceof ${0:Class}` |
106106

107107
### Promises
108108
| Prefix | Desc | Body |
109109
| -----: | ------------------------ | --------------------------- |
110-
| `pr` | Promise (ES2015) | `new Promise(${0})` |
111-
| `prs` | Promise resolve (ES2015) | `Promise.resolve(${1})${0}` |
112-
| `prj` | Promise reject (ES2015) | `Promise.reject(${1})${0}` |
113-
| `pra` | Promise all (ES2015) | `Promise.all(${1})${0}` |
110+
| `pr` | Promise (ES2015) | `new Promise(${0})` |
111+
| `prs` | Promise resolve (ES2015) | `Promise.resolve(${1})${0}` |
112+
| `prj` | Promise reject (ES2015) | `Promise.reject(${1})${0}` |
113+
| `pra` | Promise all (ES2015) | `Promise.all(${1})${0}` |
114114

115115
### ES2015 Modules
116-
| Prefix | Desc | Body |
116+
| Prefix | Desc | Body |
117117
| ------: | ------------------------- | --------------------------------------------- |
118-
| `exp` | export (ES2015) | `export ${0}` |
119-
| `expd` | export default (ES2015) | `export default ${0}` |
118+
| `exp` | export (ES2015) | `export ${0}` |
119+
| `expd` | export default (ES2015) | `export default ${0}` |
120120
| `expas` | export as (ES2015) | `export { ${1} as ${2} };${0}` |
121-
| `expf` | export from (ES2015) | `export ${2:name} from '${1}';${0}` |
122-
| `imp` | import module (ES2015) | `import ${2:name} from '${1}';${0}` |
123-
| `impf` | import file (ES2015) | `import '${1}';${0}` |
121+
| `expf` | export from (ES2015) | `export ${2:name} from '${1}';${0}` |
122+
| `imp` | import module (ES2015) | `import ${2:name} from '${1}';${0}` |
123+
| `impf` | import file (ES2015) | `import '${1}';${0}` |
124124
| `impas` | import module as (ES2015) | `import ${2:*} as ${3:name} from '${1}';${0}` |
125125

126126
### Node.js
127-
| Prefix | Desc | Body |
127+
| Prefix | Desc | Body |
128128
| --------: | ---------------------- | ---------------------------------------- |
129-
| `cb` | Node.js style callback | `(err, ${1:response}) => {${0}}` |
129+
| `cb` | Node.js style callback | `(err, ${1:response}) => {${0}}` |
130130
| `require` | require | `require(${1:path})${0}` |
131-
| `req` | require assignment | `const ${2:name} = require('${1}');${0}` |
132-
| `em` | exports.member | `exports.${1} = ${2};${0}` |
133-
| `me` | module.exports | `module.exports = ${1}${0}` |
134-
| `on` | event handler | `on('${1:event}', ${2:callback});${0}` |
131+
| `req` | require assignment | `const ${2:name} = require('${1}');${0}` |
132+
| `em` | exports.member | `exports.${1} = ${2};${0}` |
133+
| `me` | module.exports | `module.exports = ${1}${0}` |
134+
| `on` | event handler | `on('${1:event}', ${2:callback});${0}` |
135135

136136
### Console
137137
| Prefix | Desc | Body |
138138
| -----: | --------------------- | --------------------------------- |
139-
| `cl` | console.log | `console.log(${1})${0}` |
140-
| `ce` | console.error | `console.error(${1})${0}` |
141-
| `cw` | console.warn | `console.warn(${1})${0}` |
142-
| `cll` | console.log labeled | `console.log('${1}', ${1})${0}` |
143-
| `cel` | console.error labeled | `console.error('${1}', ${1})${0}` |
144-
| `cwl` | console.warn labeled | `console.warn('${1}', ${1})${0}` |
139+
| `cl` | console.log | `console.log(${1})${0}` |
140+
| `ce` | console.error | `console.error(${1})${0}` |
141+
| `cw` | console.warn | `console.warn(${1})${0}` |
142+
| `cll` | console.log labeled | `console.log('${1}', ${1})${0}` |
143+
| `cel` | console.error labeled | `console.error('${1}', ${1})${0}` |
144+
| `cwl` | console.warn labeled | `console.warn('${1}', ${1})${0}` |
145145

146146
### Timers
147-
| Prefix | Desc | Body |
148-
| ---------: | -------------------------- | -------------------------------------------- |
149-
| `sett` | setTimeout | `setTimeout(${2:callback}, ${1:delay})${0}` |
150-
| `setin` | setInterval | `setInterval(${2:callback}, ${1:delay})${0}` |
151-
| `setim` | setImmediate (node.js) | `setImmediate(${1:callback}${2})${0}` |
152-
| `nexttick` | process nextTick (node.js) | `process.nextTick(${1});${0}` |
147+
| Prefix | Desc | Body |
148+
| ------: | -------------------------- | -------------------------------------------- |
149+
| `sett` | setTimeout | `setTimeout(${2:callback}, ${1:delay})${0}` |
150+
| `setin` | setInterval | `setInterval(${2:callback}, ${1:delay})${0}` |
151+
| `setim` | setImmediate (node.js) | `setImmediate(${1:callback}${2})${0}` |
152+
| `nt` | process nextTick (node.js) | `process.nextTick(${1});${0}` |
153153

154154
### Miscellaneous
155155
| Prefix | Desc | Body |
156156
| -----: | ----------------------------- | --------------- |
157-
| `us` | insert 'use strict' statement | `'use strict';` |
157+
| `us` | insert 'use strict' statement | `'use strict';` |
158158

159159
### TypeScript
160160
| Prefix | Desc | Body |
161161
| -----: | ---------------------------------------------- | -------------------------------- |
162-
| `typ` | type (TypeScript) | `type ${1:name} = ${0}` |
163-
| `int` | interface (TypeScript) | `interface ${1:name} {${2}}${0}` |
162+
| `typ` | type (TypeScript) | `type ${1:name} = ${0}` |
163+
| `int` | interface (TypeScript) | `interface ${1:name} {${2}}${0}` |
164164
| `enum` | enum (TypeScript) | `enum ${1:name} {${2}}${0}` |
165-
| `mod` | module (TypeScript) | `module ${1:name} {${2}}${0}` |
166-
| `nam` | namespace (TypeScript) | `namespace ${1:name} {${2}}${0}` |
167-
| `pd` | parameter destructuring with type (TypeScript) | `${2} : ${1:type}$0` |
165+
| `mod` | module (TypeScript) | `module ${1:name} {${2}}${0}` |
166+
| `nam` | namespace (TypeScript) | `namespace ${1:name} {${2}}${0}` |
167+
| `pd` | parameter destructuring with type (TypeScript) | `${2} : ${1:type}$0` |

snippets/hyper-js.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
"description": "setImmediate (Node.JS)"
358358
},
359359
"process nextTick": {
360-
"prefix": "nextick",
360+
"prefix": "nt",
361361
"body": "process.nextTick(${1});${0}",
362362
"description": "process nextTick (Node.JS)"
363363
},

0 commit comments

Comments
 (0)