node-shortcuts 1.0.5 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cleanup-snippets.js +67 -0
- package/package.json +5 -6
- package/sync-snippets.js +85 -63
- package/snippets/node.json +0 -306
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
|
|
8
|
+
const HOME = os.homedir();
|
|
9
|
+
|
|
10
|
+
function getSnippetTargets() {
|
|
11
|
+
if (process.platform === 'win32') {
|
|
12
|
+
return [
|
|
13
|
+
path.join(HOME, 'AppData', 'Roaming', 'Code', 'User', 'snippets', 'javascript.json'),
|
|
14
|
+
path.join(HOME, 'AppData', 'Roaming', 'Code - Insiders', 'User', 'snippets', 'javascript.json')
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (process.platform === 'darwin') {
|
|
19
|
+
return [
|
|
20
|
+
path.join(HOME, 'Library', 'Application Support', 'Code', 'User', 'snippets', 'javascript.json'),
|
|
21
|
+
path.join(HOME, 'Library', 'Application Support', 'Code - Insiders', 'User', 'snippets', 'javascript.json')
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
path.join(HOME, '.config', 'Code', 'User', 'snippets', 'javascript.json'),
|
|
27
|
+
path.join(HOME, '.config', 'Code - Insiders', 'User', 'snippets', 'javascript.json')
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function readJSON(file) {
|
|
32
|
+
if (!fs.existsSync(file)) return {};
|
|
33
|
+
|
|
34
|
+
let raw = fs.readFileSync(file, 'utf8');
|
|
35
|
+
raw = raw.replace(/\/\/.*$/gm, '');
|
|
36
|
+
raw = raw.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
37
|
+
raw = raw.replace(/,\s*([}\]])/g, '$1');
|
|
38
|
+
|
|
39
|
+
return raw.trim() ? JSON.parse(raw) : {};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function writeJSON(file, data) {
|
|
43
|
+
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const TARGETS = getSnippetTargets();
|
|
47
|
+
|
|
48
|
+
for (const target of TARGETS) {
|
|
49
|
+
try {
|
|
50
|
+
const snippets = readJSON(target);
|
|
51
|
+
let removed = 0;
|
|
52
|
+
|
|
53
|
+
for (const key of Object.keys(snippets)) {
|
|
54
|
+
if (key.startsWith('Node.js ')) {
|
|
55
|
+
delete snippets[key];
|
|
56
|
+
removed++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (removed > 0) {
|
|
61
|
+
writeJSON(target, snippets);
|
|
62
|
+
console.log(`🧹 Cleaned ${removed} snippets from: ${target}`);
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
console.warn(`⚠ Skipped invalid snippet file: ${target}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-shortcuts",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Node Shortcut snippets",
|
|
5
5
|
"main": "sync-snippets.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
"postinstall": "node sync-snippets.js",
|
|
8
|
+
"preuninstall": "node cleanup-snippets.js"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [],
|
|
10
|
+
"keywords": ["node", "shortcuts", "snippets", "visual studio code", "vsc"],
|
|
11
11
|
"author": "krispowers",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"engines": {
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"sync-snippets.js",
|
|
18
|
-
"cleanup-snippets",
|
|
19
|
-
"snippets/",
|
|
18
|
+
"cleanup-snippets.js",
|
|
20
19
|
"README.md",
|
|
21
20
|
"LICENSE"
|
|
22
21
|
]
|
package/sync-snippets.js
CHANGED
|
@@ -5,105 +5,127 @@ import fs from 'fs';
|
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import os from 'os';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
// -----------------------------
|
|
9
|
+
// Remote source file (canonical snippets)
|
|
10
|
+
// -----------------------------
|
|
11
|
+
const SOURCE_URL = 'https://node-snippets.krispowers.dev/vsc.json';
|
|
12
|
+
|
|
13
|
+
// -----------------------------
|
|
14
|
+
// Cross-platform VS Code + Insiders targets
|
|
15
|
+
// -----------------------------
|
|
16
|
+
function getVSCodeTargets() {
|
|
17
|
+
const home = os.homedir();
|
|
18
|
+
const files = ['javascript.json', 'typescript.json']; // Auto JS + TS
|
|
19
|
+
|
|
20
|
+
const bases = (() => {
|
|
21
|
+
switch (process.platform) {
|
|
22
|
+
case 'win32':
|
|
23
|
+
return [
|
|
24
|
+
path.join(home, 'AppData', 'Roaming', 'Code', 'User', 'snippets'),
|
|
25
|
+
path.join(home, 'AppData', 'Roaming', 'Code - Insiders', 'User', 'snippets')
|
|
26
|
+
];
|
|
27
|
+
case 'darwin':
|
|
28
|
+
return [
|
|
29
|
+
path.join(home, 'Library', 'Application Support', 'Code', 'User', 'snippets'),
|
|
30
|
+
path.join(home, 'Library', 'Application Support', 'Code - Insiders', 'User', 'snippets')
|
|
31
|
+
];
|
|
32
|
+
default: // linux
|
|
33
|
+
return [
|
|
34
|
+
path.join(home, '.config', 'Code', 'User', 'snippets'),
|
|
35
|
+
path.join(home, '.config', 'Code - Insiders', 'User', 'snippets')
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
})();
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
return [
|
|
32
|
-
path.join(HOME, '.config', 'Code', 'User', 'snippets', 'javascript.json'),
|
|
33
|
-
path.join(HOME, '.config', 'Code - Insiders', 'User', 'snippets', 'javascript.json')
|
|
34
|
-
];
|
|
40
|
+
return bases.flatMap(base => files.map(file => path.join(base, file)));
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Read JSONC safely (VS Code compatible)
|
|
42
|
-
*/
|
|
43
|
+
// -----------------------------
|
|
44
|
+
// JSONC-safe read
|
|
45
|
+
// -----------------------------
|
|
43
46
|
function readJSON(file) {
|
|
44
47
|
if (!fs.existsSync(file)) return {};
|
|
45
48
|
|
|
46
49
|
let raw = fs.readFileSync(file, 'utf8');
|
|
47
50
|
if (!raw.trim()) return {};
|
|
48
51
|
|
|
49
|
-
// Strip // comments
|
|
50
52
|
raw = raw.replace(/\/\/.*$/gm, '');
|
|
51
|
-
|
|
52
|
-
// Strip /* */ comments
|
|
53
53
|
raw = raw.replace(/\/\*[\s\S]*?\*\//g, '');
|
|
54
|
-
|
|
55
|
-
// Strip trailing commas
|
|
56
54
|
raw = raw.replace(/,\s*([}\]])/g, '$1');
|
|
57
55
|
|
|
58
56
|
return JSON.parse(raw);
|
|
59
57
|
}
|
|
60
58
|
|
|
59
|
+
// -----------------------------
|
|
60
|
+
// Ensure directory exists
|
|
61
|
+
// -----------------------------
|
|
61
62
|
function ensureDir(file) {
|
|
62
63
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
// -----------------------------
|
|
67
|
+
// Write JSON safely
|
|
68
|
+
// -----------------------------
|
|
65
69
|
function writeJSON(file, data) {
|
|
66
70
|
ensureDir(file);
|
|
67
71
|
fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
|
68
72
|
}
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
// -----------------------------
|
|
75
|
+
// Fetch remote JSON source
|
|
76
|
+
// -----------------------------
|
|
77
|
+
async function fetchRemoteSnippets() {
|
|
78
|
+
const res = await fetch(SOURCE_URL);
|
|
79
|
+
if (!res.ok) throw new Error(`Failed to fetch snippets: ${res.status}`);
|
|
80
|
+
return await res.json();
|
|
81
|
+
}
|
|
76
82
|
|
|
83
|
+
// -----------------------------
|
|
84
|
+
// Sync snippets
|
|
85
|
+
// -----------------------------
|
|
86
|
+
function mergeSnippets(userSnippets, sourceSnippets) {
|
|
77
87
|
let added = 0;
|
|
78
88
|
let updated = 0;
|
|
79
89
|
|
|
80
|
-
for (const [key, snippet] of Object.entries(
|
|
81
|
-
if (!
|
|
82
|
-
else if (JSON.stringify(
|
|
83
|
-
|
|
84
|
-
user[key] = snippet;
|
|
90
|
+
for (const [key, snippet] of Object.entries(sourceSnippets)) {
|
|
91
|
+
if (!userSnippets[key]) added++;
|
|
92
|
+
else if (JSON.stringify(userSnippets[key]) !== JSON.stringify(snippet)) updated++;
|
|
93
|
+
userSnippets[key] = snippet;
|
|
85
94
|
}
|
|
86
95
|
|
|
87
|
-
|
|
96
|
+
return { merged: userSnippets, added, updated };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function sync(target) {
|
|
100
|
+
const sourceSnippets = await fetchRemoteSnippets();
|
|
101
|
+
const userSnippets = readJSON(target);
|
|
102
|
+
|
|
103
|
+
const { merged, added, updated } = mergeSnippets(userSnippets, sourceSnippets);
|
|
104
|
+
|
|
105
|
+
writeJSON(target, merged);
|
|
88
106
|
|
|
89
107
|
console.log(`✔ Synced: ${target}`);
|
|
90
108
|
console.log(` ➕ Added: ${added}`);
|
|
91
109
|
console.log(` 🔄 Updated: ${updated}`);
|
|
92
110
|
}
|
|
93
111
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
// -----------------------------
|
|
113
|
+
// Run sync for all targets
|
|
114
|
+
// -----------------------------
|
|
115
|
+
(async () => {
|
|
116
|
+
try {
|
|
117
|
+
const TARGETS = getVSCodeTargets();
|
|
118
|
+
for (const target of TARGETS) {
|
|
119
|
+
try {
|
|
120
|
+
await sync(target);
|
|
121
|
+
} catch (err) {
|
|
122
|
+
console.warn(`⚠ Skipped invalid snippet file: ${target}`);
|
|
123
|
+
console.error(err.message);
|
|
124
|
+
}
|
|
103
125
|
}
|
|
126
|
+
} catch (err) {
|
|
127
|
+
console.error('❌ Snippet sync failed');
|
|
128
|
+
console.error(err);
|
|
129
|
+
process.exit(1);
|
|
104
130
|
}
|
|
105
|
-
}
|
|
106
|
-
console.error('❌ Snippet sync failed');
|
|
107
|
-
console.error(err);
|
|
108
|
-
process.exit(1);
|
|
109
|
-
}
|
|
131
|
+
})();
|
package/snippets/node.json
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Node.js HTTP Import": {
|
|
3
|
-
"prefix": "@http",
|
|
4
|
-
"scope": "javascript",
|
|
5
|
-
"body": [
|
|
6
|
-
"import http from 'node:http';"
|
|
7
|
-
],
|
|
8
|
-
"description": "Node.js HTTP Import"
|
|
9
|
-
},
|
|
10
|
-
"Node.js HTTPS Import": {
|
|
11
|
-
"prefix": "@https",
|
|
12
|
-
"scope": "javascript",
|
|
13
|
-
"body": [
|
|
14
|
-
"import https from 'node:https';"
|
|
15
|
-
],
|
|
16
|
-
"description": "Node.js HTTPS Import"
|
|
17
|
-
},
|
|
18
|
-
"Node.js NET Import": {
|
|
19
|
-
"prefix": "@net",
|
|
20
|
-
"scope": "javascript",
|
|
21
|
-
"body": [
|
|
22
|
-
"import net from 'node:net';"
|
|
23
|
-
],
|
|
24
|
-
"description": "Node.js NET Import"
|
|
25
|
-
},
|
|
26
|
-
"Node.js DGRAM Import": {
|
|
27
|
-
"prefix": "@dgram",
|
|
28
|
-
"scope": "javascript",
|
|
29
|
-
"body": [
|
|
30
|
-
"import dgram from 'node:dgram';"
|
|
31
|
-
],
|
|
32
|
-
"description": "Node.js DGRAM Import"
|
|
33
|
-
},
|
|
34
|
-
"Node.js FS Import": {
|
|
35
|
-
"prefix": "@fs",
|
|
36
|
-
"scope": "javascript",
|
|
37
|
-
"body": [
|
|
38
|
-
"import fs from 'node:fs';"
|
|
39
|
-
],
|
|
40
|
-
"description": "Node.js FS Import"
|
|
41
|
-
},
|
|
42
|
-
"Node.js fsPromises Import": {
|
|
43
|
-
"prefix": ["@fspromises", "@fsp"],
|
|
44
|
-
"scope": "javascript",
|
|
45
|
-
"body": [
|
|
46
|
-
"import fsPromises from 'node:fs/promises';"
|
|
47
|
-
],
|
|
48
|
-
"description": "Node.js FSPROMISES Import"
|
|
49
|
-
},
|
|
50
|
-
"Node.js Path Import": {
|
|
51
|
-
"prefix": "@path",
|
|
52
|
-
"scope": "javascript",
|
|
53
|
-
"body": [
|
|
54
|
-
"import path from 'node:path';"
|
|
55
|
-
],
|
|
56
|
-
"description": "Node.js PATH Import"
|
|
57
|
-
},
|
|
58
|
-
"Node.js OS Import": {
|
|
59
|
-
"prefix": "@os",
|
|
60
|
-
"scope": "javascript",
|
|
61
|
-
"body": [
|
|
62
|
-
"import os from 'node:os';"
|
|
63
|
-
],
|
|
64
|
-
"description": "Node.js OS Import"
|
|
65
|
-
},
|
|
66
|
-
"Node.js PROCESS Import": {
|
|
67
|
-
"prefix": "@process",
|
|
68
|
-
"scope": "javascript",
|
|
69
|
-
"body": [
|
|
70
|
-
"import process from 'node:process';"
|
|
71
|
-
],
|
|
72
|
-
"description": "Node.js PROCESS Import"
|
|
73
|
-
},
|
|
74
|
-
"Node.js STREAM Import": {
|
|
75
|
-
"prefix": "@stream",
|
|
76
|
-
"scope": "javascript",
|
|
77
|
-
"body": [
|
|
78
|
-
"import stream from 'node:stream';"
|
|
79
|
-
],
|
|
80
|
-
"description": "Node.js STREAM Import"
|
|
81
|
-
},
|
|
82
|
-
"Node.js BUFFER Import": {
|
|
83
|
-
"prefix": "@buffer",
|
|
84
|
-
"scope": "javascript",
|
|
85
|
-
"body": [
|
|
86
|
-
"import buffer from 'node:buffer';"
|
|
87
|
-
],
|
|
88
|
-
"description": "Node.js BUFFER Import"
|
|
89
|
-
},
|
|
90
|
-
"Node.js URL Import": {
|
|
91
|
-
"prefix": "@url",
|
|
92
|
-
"scope": "javascript",
|
|
93
|
-
"body": [
|
|
94
|
-
"import url from 'node:url';"
|
|
95
|
-
],
|
|
96
|
-
"description": "Node.js URL Import"
|
|
97
|
-
},
|
|
98
|
-
"Node.js QUERYSTRING Import": {
|
|
99
|
-
"prefix": ["@querystring", "@qs"],
|
|
100
|
-
"scope": "javascript",
|
|
101
|
-
"body": [
|
|
102
|
-
"import querystring from 'node:querystring';"
|
|
103
|
-
],
|
|
104
|
-
"description": "Node.js QUERYSTRING Import"
|
|
105
|
-
},
|
|
106
|
-
"Node.js PUNYCODE Import": {
|
|
107
|
-
"prefix": ["@punycode", "@pc", "@puny"],
|
|
108
|
-
"scope": "javascript",
|
|
109
|
-
"body": [
|
|
110
|
-
"import punycode from 'node:punycode';"
|
|
111
|
-
],
|
|
112
|
-
"description": "Node.js PUNYCODE Import"
|
|
113
|
-
},
|
|
114
|
-
"Node.js CRYPTO Import": {
|
|
115
|
-
"prefix": "@crypto",
|
|
116
|
-
"scope": "javascript",
|
|
117
|
-
"body": [
|
|
118
|
-
"import crypto from 'node:crypto';"
|
|
119
|
-
],
|
|
120
|
-
"description": "Node.js CRYPTO Import"
|
|
121
|
-
},
|
|
122
|
-
"Node.js TLS Import": {
|
|
123
|
-
"prefix": "@tls",
|
|
124
|
-
"scope": "javascript",
|
|
125
|
-
"body": [
|
|
126
|
-
"import tls from 'node:tls';"
|
|
127
|
-
],
|
|
128
|
-
"description": "Node.js TLS Import"
|
|
129
|
-
},
|
|
130
|
-
"Node.js ZLIB Import": {
|
|
131
|
-
"prefix": "@zlib",
|
|
132
|
-
"scope": "javascript",
|
|
133
|
-
"body": [
|
|
134
|
-
"import zlib from 'node:zlib';"
|
|
135
|
-
],
|
|
136
|
-
"description": "Node.js ZLIB Import"
|
|
137
|
-
},
|
|
138
|
-
"Node.js UTIL Import": {
|
|
139
|
-
"prefix": "@util",
|
|
140
|
-
"scope": "javascript",
|
|
141
|
-
"body": [
|
|
142
|
-
"import util from 'node:util';"
|
|
143
|
-
],
|
|
144
|
-
"description": "Node.js UTIL Import"
|
|
145
|
-
},
|
|
146
|
-
"Node.js EVENTS Import": {
|
|
147
|
-
"prefix": "@events",
|
|
148
|
-
"scope": "javascript",
|
|
149
|
-
"body": [
|
|
150
|
-
"import events from 'node:events';"
|
|
151
|
-
],
|
|
152
|
-
"description": "Node.js EVENTS Import"
|
|
153
|
-
},
|
|
154
|
-
"Node.js ASSERT Import": {
|
|
155
|
-
"prefix": "@assert",
|
|
156
|
-
"scope": "javascript",
|
|
157
|
-
"body": [
|
|
158
|
-
"import assert from 'node:assert';"
|
|
159
|
-
],
|
|
160
|
-
"description": "Node.js ASSERT Import"
|
|
161
|
-
},
|
|
162
|
-
"Node.js STRING DECODER Import": {
|
|
163
|
-
"prefix": ["@stringdecoder", "@sd"],
|
|
164
|
-
"scope": "javascript",
|
|
165
|
-
"body": [
|
|
166
|
-
"import stringDecoder from 'node:string_decoder';"
|
|
167
|
-
],
|
|
168
|
-
"description": "Node.js STRING DECODER Import"
|
|
169
|
-
},
|
|
170
|
-
"Node.js CHILD PROCESS Import": {
|
|
171
|
-
"prefix": ["@childprocess", "@cp"],
|
|
172
|
-
"scope": "javascript",
|
|
173
|
-
"body": [
|
|
174
|
-
"import childProcess from 'node:child_process';"
|
|
175
|
-
],
|
|
176
|
-
"description": "Node.js CHILD PROCESS Import"
|
|
177
|
-
},
|
|
178
|
-
"Node.js WORKER THREADS Import": {
|
|
179
|
-
"prefix": ["@workerthreads", "@wt"],
|
|
180
|
-
"scope": "javascript",
|
|
181
|
-
"body": [
|
|
182
|
-
"import workerThreads from 'node:worker_threads';"
|
|
183
|
-
],
|
|
184
|
-
"description": "Node.js WORKER THREADS Import"
|
|
185
|
-
},
|
|
186
|
-
"Node.js CLUSTER Import": {
|
|
187
|
-
"prefix": "@cluster",
|
|
188
|
-
"scope": "javascript",
|
|
189
|
-
"body": [
|
|
190
|
-
"import cluster from 'node:cluster';"
|
|
191
|
-
],
|
|
192
|
-
"description": "Node.js CLUSTER Import"
|
|
193
|
-
},
|
|
194
|
-
"Node.js PERF HOOKS Import": {
|
|
195
|
-
"prefix": ["@perfhooks", "@perf"],
|
|
196
|
-
"scope": "javascript",
|
|
197
|
-
"body": [
|
|
198
|
-
"import perfHooks from 'node:perf_hooks';"
|
|
199
|
-
],
|
|
200
|
-
"description": "Node.js PERF HOOKS Import"
|
|
201
|
-
},
|
|
202
|
-
"Node.js INSPECTOR Import": {
|
|
203
|
-
"prefix": "@inspector",
|
|
204
|
-
"scope": "javascript",
|
|
205
|
-
"body": [
|
|
206
|
-
"import inspector from 'node:inspector';"
|
|
207
|
-
],
|
|
208
|
-
"description": "Node.js INSPECTOR Import"
|
|
209
|
-
},
|
|
210
|
-
"Node.js DIAGNOSTICS CHANNEL Import": {
|
|
211
|
-
"prefix": ["@diagnostics", "@dc"],
|
|
212
|
-
"scope": "javascript",
|
|
213
|
-
"body": [
|
|
214
|
-
"import diagnosticsChannel from 'node:diagnostics_channel';"
|
|
215
|
-
],
|
|
216
|
-
"description": "Node.js DIAGNOSTICS CHANNEL Import"
|
|
217
|
-
},
|
|
218
|
-
"Node.js MODULE Import": {
|
|
219
|
-
"prefix": "@module",
|
|
220
|
-
"scope": "javascript",
|
|
221
|
-
"body": [
|
|
222
|
-
"import module from 'node:module';"
|
|
223
|
-
],
|
|
224
|
-
"description": "Node.js MODULE Import"
|
|
225
|
-
},
|
|
226
|
-
"Node.js VM Import": {
|
|
227
|
-
"prefix": "@vm",
|
|
228
|
-
"scope": "javascript",
|
|
229
|
-
"body": [
|
|
230
|
-
"import vm from 'node:vm';"
|
|
231
|
-
],
|
|
232
|
-
"description": "Node.js VM Import"
|
|
233
|
-
},
|
|
234
|
-
"Node.js TIMERS Import": {
|
|
235
|
-
"prefix": "@timers",
|
|
236
|
-
"scope": "javascript",
|
|
237
|
-
"body": [
|
|
238
|
-
"import timers from 'node:timers';"
|
|
239
|
-
],
|
|
240
|
-
"description": "Node.js TIMERS Import"
|
|
241
|
-
},
|
|
242
|
-
"Node.js TIMERS PROMISES Import": {
|
|
243
|
-
"prefix": ["@timerspromises", "@tp"],
|
|
244
|
-
"scope": "javascript",
|
|
245
|
-
"body": [
|
|
246
|
-
"import timersPromises from 'node:timers/promises';"
|
|
247
|
-
],
|
|
248
|
-
"description": "Node.js TIMERS PROMISES Import"
|
|
249
|
-
},
|
|
250
|
-
"Node.js REPL Import": {
|
|
251
|
-
"prefix": "@repl",
|
|
252
|
-
"scope": "javascript",
|
|
253
|
-
"body": [
|
|
254
|
-
"import repl from 'node:repl';"
|
|
255
|
-
],
|
|
256
|
-
"description": "Node.js REPL Import"
|
|
257
|
-
},
|
|
258
|
-
"Node.js READLINE Import": {
|
|
259
|
-
"prefix": "@readline",
|
|
260
|
-
"scope": "javascript",
|
|
261
|
-
"body": [
|
|
262
|
-
"import readline from 'node:readline';"
|
|
263
|
-
],
|
|
264
|
-
"description": "Node.js READLINE Import"
|
|
265
|
-
},
|
|
266
|
-
"Node.js TTY Import": {
|
|
267
|
-
"prefix": "@tty",
|
|
268
|
-
"scope": "javascript",
|
|
269
|
-
"body": [
|
|
270
|
-
"import tty from 'node:tty';"
|
|
271
|
-
],
|
|
272
|
-
"description": "Node.js TTY Import"
|
|
273
|
-
},
|
|
274
|
-
"Node.js DNS Import": {
|
|
275
|
-
"prefix": "@dns",
|
|
276
|
-
"scope": "javascript",
|
|
277
|
-
"body": [
|
|
278
|
-
"import dns from 'node:dns';"
|
|
279
|
-
],
|
|
280
|
-
"description": "Node.js DNS Import"
|
|
281
|
-
},
|
|
282
|
-
"Node.js DNS PROMISES Import": {
|
|
283
|
-
"prefix": ["@dnspromises", "@dnsp"],
|
|
284
|
-
"scope": "javascript",
|
|
285
|
-
"body": [
|
|
286
|
-
"import dnsPromises from 'node:dns/promises';"
|
|
287
|
-
],
|
|
288
|
-
"description": "Node.js DNS PROMISES Import"
|
|
289
|
-
},
|
|
290
|
-
"Node.js V8 Import": {
|
|
291
|
-
"prefix": "@v8",
|
|
292
|
-
"scope": "javascript",
|
|
293
|
-
"body": [
|
|
294
|
-
"import v8 from 'node:v8';"
|
|
295
|
-
],
|
|
296
|
-
"description": "Node.js V8 Import"
|
|
297
|
-
},
|
|
298
|
-
"Node.js WASI Import": {
|
|
299
|
-
"prefix": "@wasi",
|
|
300
|
-
"scope": "javascript",
|
|
301
|
-
"body": [
|
|
302
|
-
"import wasi from 'node:wasi';"
|
|
303
|
-
],
|
|
304
|
-
"description": "Node.js WASI Import"
|
|
305
|
-
}
|
|
306
|
-
}
|