Skip to content

Commit 9352145

Browse files
committed
feat: add im, imm, imu, and imd
1 parent 48affe1 commit 9352145

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

README.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,20 @@ Related snippets share a same namespace, like every `for` loop prefix start with
129129
| `prt` | Promise type (TypeScript) | `Promise<$0>` |
130130

131131
### ES2015 Modules
132-
| Prefix | Desc | Body |
133-
| ------: | ------------------------- | ----------------------------------------- |
134-
| `exp` | export (ES2015) | `export $0` |
135-
| `expd` | export default (ES2015) | `export default $0` |
136-
| `expas` | export as (ES2015) | `export { $1 as $2 };$0` |
137-
| `expf` | export from (ES2015) | `export ${2:name} from '$1';$0` |
138-
| `expaf` | export all from (ES2015) | `export *$2 from '$1';$0` |
139-
| `imp` | import module (ES2015) | `import ${2:name} from '$1';$0` |
140-
| `imf` | import file (ES2015) | `import '$1';$0` |
141-
| `impas` | import module as (ES2015) | `import ${2:*} as ${3:name} from '$1';$0` |
132+
| Prefix | Desc | Body |
133+
| ------: | ---------------------------------- | ----------------------------------------- |
134+
| `exp` | export (ES2015) | `export $0` |
135+
| `expd` | export default (ES2015) | `export default $0` |
136+
| `expas` | export as (ES2015) | `export { $1 as $2 };$0` |
137+
| `expf` | export from (ES2015) | `export ${2:name} from '$1';$0` |
138+
| `expaf` | export all from (ES2015) | `export *$2 from '$1';$0` |
139+
| `im` | import (ES2015) | `import$0` |
140+
| `imm` | import.meta (ES2015) | `import.meta$0` |
141+
| `imu` | import.meta.url (ES2015) | `import.meta.url$0` |
142+
| `imp` | import module (ES2015) | `import ${2:name} from '$1';$0` |
143+
| `imd` | import module dynamically (ES2020) | `import($1)$0` |
144+
| `imf` | import file (ES2015) | `import '$1';$0` |
145+
| `impas` | import module as (ES2015) | `import ${2:*} as ${3:name} from '$1';$0` |
142146

143147
### Node.js
144148
| Prefix | Desc | Body |

src/snippet/javascript.ts

+16
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,26 @@ export const javascript = createXSnippets({
218218
name: 'export all from (ES2015)',
219219
body: "export *$2 from '$1';$0",
220220
},
221+
im: {
222+
name: 'import (ES2015)',
223+
body: 'import$0',
224+
},
225+
imm: {
226+
name: 'import.meta (ES2015)',
227+
body: 'import.meta$0',
228+
},
229+
imu: {
230+
name: 'import.meta.url (ES2015)',
231+
body: 'import.meta.url$0',
232+
},
221233
imp: {
222234
name: 'import module (ES2015)',
223235
body: "import ${2:name} from '$1';$0",
224236
},
237+
imd: {
238+
name: 'import module dynamically (ES2020)',
239+
body: 'import($1)$0',
240+
},
225241
imf: {
226242
name: 'import file (ES2015)',
227243
body: "import '$1';$0",

0 commit comments

Comments
 (0)