simen-keyboard-listener 1.0.0 → 1.0.2
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/dist/index.d.mts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +167 -0
- package/dist/index.mjs +137 -0
- package/package.json +11 -9
- package/src/native/build/Makefile +0 -347
- package/src/native/build/Release/.deps/Release/obj.target/simen_keyboard_listener/simen_keyboard_listener.o.d +0 -18
- package/src/native/build/Release/.deps/Release/simen_keyboard_listener.node.d +0 -1
- package/src/native/build/Release/obj.target/simen_keyboard_listener/simen_keyboard_listener.o +0 -0
- package/src/native/build/Release/simen_keyboard_listener.node +0 -0
- package/src/native/build/binding.Makefile +0 -6
- package/src/native/build/gyp-mac-tool +0 -772
- package/src/native/build/simen_keyboard_listener.target.mk +0 -199
- package/src/native/node_modules/.package-lock.json +0 -17
- package/src/native/node_modules/node-addon-api/LICENSE.md +0 -9
- package/src/native/node_modules/node-addon-api/README.md +0 -95
- package/src/native/node_modules/node-addon-api/common.gypi +0 -21
- package/src/native/node_modules/node-addon-api/except.gypi +0 -25
- package/src/native/node_modules/node-addon-api/index.js +0 -14
- package/src/native/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
- package/src/native/node_modules/node-addon-api/napi-inl.h +0 -7033
- package/src/native/node_modules/node-addon-api/napi.h +0 -3309
- package/src/native/node_modules/node-addon-api/node_addon_api.gyp +0 -42
- package/src/native/node_modules/node-addon-api/node_api.gyp +0 -9
- package/src/native/node_modules/node-addon-api/noexcept.gypi +0 -26
- package/src/native/node_modules/node-addon-api/nothing.c +0 -0
- package/src/native/node_modules/node-addon-api/package-support.json +0 -21
- package/src/native/node_modules/node-addon-api/package.json +0 -480
- package/src/native/node_modules/node-addon-api/tools/README.md +0 -73
- package/src/native/node_modules/node-addon-api/tools/check-napi.js +0 -99
- package/src/native/node_modules/node-addon-api/tools/clang-format.js +0 -71
- package/src/native/node_modules/node-addon-api/tools/conversion.js +0 -301
- package/src/native/package-lock.json +0 -25
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
'targets': [
|
|
3
|
-
{
|
|
4
|
-
'target_name': 'node_addon_api',
|
|
5
|
-
'type': 'none',
|
|
6
|
-
'sources': [ 'napi.h', 'napi-inl.h' ],
|
|
7
|
-
'direct_dependent_settings': {
|
|
8
|
-
'include_dirs': [ '.' ],
|
|
9
|
-
'includes': ['noexcept.gypi'],
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
'target_name': 'node_addon_api_except',
|
|
14
|
-
'type': 'none',
|
|
15
|
-
'sources': [ 'napi.h', 'napi-inl.h' ],
|
|
16
|
-
'direct_dependent_settings': {
|
|
17
|
-
'include_dirs': [ '.' ],
|
|
18
|
-
'includes': ['except.gypi'],
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
'target_name': 'node_addon_api_except_all',
|
|
23
|
-
'type': 'none',
|
|
24
|
-
'sources': [ 'napi.h', 'napi-inl.h' ],
|
|
25
|
-
'direct_dependent_settings': {
|
|
26
|
-
'include_dirs': [ '.' ],
|
|
27
|
-
'includes': ['except.gypi'],
|
|
28
|
-
'defines': [ 'NODE_ADDON_API_CPP_EXCEPTIONS_ALL' ]
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
'target_name': 'node_addon_api_maybe',
|
|
33
|
-
'type': 'none',
|
|
34
|
-
'sources': [ 'napi.h', 'napi-inl.h' ],
|
|
35
|
-
'direct_dependent_settings': {
|
|
36
|
-
'include_dirs': [ '.' ],
|
|
37
|
-
'includes': ['noexcept.gypi'],
|
|
38
|
-
'defines': ['NODE_ADDON_API_ENABLE_MAYBE']
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
]
|
|
42
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
'defines': [ 'NODE_ADDON_API_DISABLE_CPP_EXCEPTIONS' ],
|
|
3
|
-
'cflags': [ '-fno-exceptions' ],
|
|
4
|
-
'cflags_cc': [ '-fno-exceptions' ],
|
|
5
|
-
'conditions': [
|
|
6
|
-
["OS=='win'", {
|
|
7
|
-
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
|
|
8
|
-
#"defines": [
|
|
9
|
-
# "_HAS_EXCEPTIONS=0"
|
|
10
|
-
#],
|
|
11
|
-
"msvs_settings": {
|
|
12
|
-
"VCCLCompilerTool": {
|
|
13
|
-
'ExceptionHandling': 0,
|
|
14
|
-
'EnablePREfast': 'true',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
}],
|
|
18
|
-
["OS=='mac'", {
|
|
19
|
-
'xcode_settings': {
|
|
20
|
-
'CLANG_CXX_LIBRARY': 'libc++',
|
|
21
|
-
'MACOSX_DEPLOYMENT_TARGET': '10.7',
|
|
22
|
-
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
|
|
23
|
-
},
|
|
24
|
-
}],
|
|
25
|
-
],
|
|
26
|
-
}
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"versions": [
|
|
3
|
-
{
|
|
4
|
-
"version": "*",
|
|
5
|
-
"target": {
|
|
6
|
-
"node": "active"
|
|
7
|
-
},
|
|
8
|
-
"response": {
|
|
9
|
-
"type": "time-permitting",
|
|
10
|
-
"paid": false,
|
|
11
|
-
"contact": {
|
|
12
|
-
"name": "node-addon-api team",
|
|
13
|
-
"url": "https://github.com/nodejs/node-addon-api/issues"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"backing": [ { "project": "https://github.com/nodejs" },
|
|
17
|
-
{ "foundation": "https://openjsf.org/" }
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"bugs": {
|
|
3
|
-
"url": "https://github.com/nodejs/node-addon-api/issues"
|
|
4
|
-
},
|
|
5
|
-
"contributors": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Abhishek Kumar Singh",
|
|
8
|
-
"url": "https://github.com/abhi11210646"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "Alba Mendez",
|
|
12
|
-
"url": "https://github.com/jmendeth"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "Alexander Floh",
|
|
16
|
-
"url": "https://github.com/alexanderfloh"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "Ammar Faizi",
|
|
20
|
-
"url": "https://github.com/ammarfaizi2"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "András Timár, Dr",
|
|
24
|
-
"url": "https://github.com/timarandras"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "Andrew Petersen",
|
|
28
|
-
"url": "https://github.com/kirbysayshi"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "Anisha Rohra",
|
|
32
|
-
"url": "https://github.com/anisha-rohra"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "Anna Henningsen",
|
|
36
|
-
"url": "https://github.com/addaleax"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "Arnaud Botella",
|
|
40
|
-
"url": "https://github.com/BotellaA"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "Arunesh Chandra",
|
|
44
|
-
"url": "https://github.com/aruneshchandra"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "Azlan Mukhtar",
|
|
48
|
-
"url": "https://github.com/azlan"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"name": "Ben Berman",
|
|
52
|
-
"url": "https://github.com/rivertam"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "Benjamin Byholm",
|
|
56
|
-
"url": "https://github.com/kkoopa"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "Bill Gallafent",
|
|
60
|
-
"url": "https://github.com/gallafent"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "blagoev",
|
|
64
|
-
"url": "https://github.com/blagoev"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "Bruce A. MacNaughton",
|
|
68
|
-
"url": "https://github.com/bmacnaughton"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "Cory Mickelson",
|
|
72
|
-
"url": "https://github.com/corymickelson"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"name": "Daniel Bevenius",
|
|
76
|
-
"url": "https://github.com/danbev"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "Dante Calderón",
|
|
80
|
-
"url": "https://github.com/dantehemerson"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"name": "Darshan Sen",
|
|
84
|
-
"url": "https://github.com/RaisinTen"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"name": "David Halls",
|
|
88
|
-
"url": "https://github.com/davedoesdev"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"name": "Deepak Rajamohan",
|
|
92
|
-
"url": "https://github.com/deepakrkris"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "Dmitry Ashkadov",
|
|
96
|
-
"url": "https://github.com/dmitryash"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"name": "Dongjin Na",
|
|
100
|
-
"url": "https://github.com/nadongguri"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"name": "Doni Rubiagatra",
|
|
104
|
-
"url": "https://github.com/rubiagatra"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "Eric Bickle",
|
|
108
|
-
"url": "https://github.com/ebickle"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"name": "extremeheat",
|
|
112
|
-
"url": "https://github.com/extremeheat"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"name": "Feng Yu",
|
|
116
|
-
"url": "https://github.com/F3n67u"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "Ferdinand Holzer",
|
|
120
|
-
"url": "https://github.com/fholzer"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"name": "Gabriel Schulhof",
|
|
124
|
-
"url": "https://github.com/gabrielschulhof"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"name": "Guenter Sandner",
|
|
128
|
-
"url": "https://github.com/gms1"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"name": "Gus Caplan",
|
|
132
|
-
"url": "https://github.com/devsnek"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"name": "Helio Frota",
|
|
136
|
-
"url": "https://github.com/helio-frota"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"name": "Hitesh Kanwathirtha",
|
|
140
|
-
"url": "https://github.com/digitalinfinity"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"name": "ikokostya",
|
|
144
|
-
"url": "https://github.com/ikokostya"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "Jack Xia",
|
|
148
|
-
"url": "https://github.com/JckXia"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
"name": "Jake Barnes",
|
|
152
|
-
"url": "https://github.com/DuBistKomisch"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"name": "Jake Yoon",
|
|
156
|
-
"url": "https://github.com/yjaeseok"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"name": "Jason Ginchereau",
|
|
160
|
-
"url": "https://github.com/jasongin"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "Jenny",
|
|
164
|
-
"url": "https://github.com/egg-bread"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "Jeroen Janssen",
|
|
168
|
-
"url": "https://github.com/japj"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"name": "Jim Schlight",
|
|
172
|
-
"url": "https://github.com/jschlight"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"name": "Jinho Bang",
|
|
176
|
-
"url": "https://github.com/romandev"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "José Expósito",
|
|
180
|
-
"url": "https://github.com/JoseExposito"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"name": "joshgarde",
|
|
184
|
-
"url": "https://github.com/joshgarde"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"name": "Julian Mesa",
|
|
188
|
-
"url": "https://github.com/julianmesa-gitkraken"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"name": "Kasumi Hanazuki",
|
|
192
|
-
"url": "https://github.com/hanazuki"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"name": "Kelvin",
|
|
196
|
-
"url": "https://github.com/kelvinhammond"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"name": "Kevin Eady",
|
|
200
|
-
"url": "https://github.com/KevinEady"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
"name": "Kévin VOYER",
|
|
204
|
-
"url": "https://github.com/kecsou"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"name": "kidneysolo",
|
|
208
|
-
"url": "https://github.com/kidneysolo"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"name": "Koki Nishihara",
|
|
212
|
-
"url": "https://github.com/Nishikoh"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
"name": "Konstantin Tarkus",
|
|
216
|
-
"url": "https://github.com/koistya"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"name": "Kyle Farnung",
|
|
220
|
-
"url": "https://github.com/kfarnung"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"name": "Kyle Kovacs",
|
|
224
|
-
"url": "https://github.com/nullromo"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
"name": "legendecas",
|
|
228
|
-
"url": "https://github.com/legendecas"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"name": "LongYinan",
|
|
232
|
-
"url": "https://github.com/Brooooooklyn"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"name": "Lovell Fuller",
|
|
236
|
-
"url": "https://github.com/lovell"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"name": "Luciano Martorella",
|
|
240
|
-
"url": "https://github.com/lmartorella"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
"name": "mastergberry",
|
|
244
|
-
"url": "https://github.com/mastergberry"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"name": "Mathias Küsel",
|
|
248
|
-
"url": "https://github.com/mathiask88"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"name": "Mathias Stearn",
|
|
252
|
-
"url": "https://github.com/RedBeard0531"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
"name": "Matteo Collina",
|
|
256
|
-
"url": "https://github.com/mcollina"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"name": "Michael Dawson",
|
|
260
|
-
"url": "https://github.com/mhdawson"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"name": "Michael Price",
|
|
264
|
-
"url": "https://github.com/mikepricedev"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "Michele Campus",
|
|
268
|
-
"url": "https://github.com/kYroL01"
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
"name": "Mikhail Cheshkov",
|
|
272
|
-
"url": "https://github.com/mcheshkov"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"name": "nempoBu4",
|
|
276
|
-
"url": "https://github.com/nempoBu4"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
"name": "Nicola Del Gobbo",
|
|
280
|
-
"url": "https://github.com/NickNaso"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
"name": "Nick Soggin",
|
|
284
|
-
"url": "https://github.com/iSkore"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"name": "Nikolai Vavilov",
|
|
288
|
-
"url": "https://github.com/seishun"
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
"name": "Nurbol Alpysbayev",
|
|
292
|
-
"url": "https://github.com/anurbol"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"name": "pacop",
|
|
296
|
-
"url": "https://github.com/pacop"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"name": "Peter Šándor",
|
|
300
|
-
"url": "https://github.com/petersandor"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"name": "Philipp Renoth",
|
|
304
|
-
"url": "https://github.com/DaAitch"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
"name": "rgerd",
|
|
308
|
-
"url": "https://github.com/rgerd"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
"name": "Richard Lau",
|
|
312
|
-
"url": "https://github.com/richardlau"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"name": "Rolf Timmermans",
|
|
316
|
-
"url": "https://github.com/rolftimmermans"
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
"name": "Ross Weir",
|
|
320
|
-
"url": "https://github.com/ross-weir"
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"name": "Ryuichi Okumura",
|
|
324
|
-
"url": "https://github.com/okuryu"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"name": "Saint Gabriel",
|
|
328
|
-
"url": "https://github.com/chineduG"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"name": "Sampson Gao",
|
|
332
|
-
"url": "https://github.com/sampsongao"
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
"name": "Sam Roberts",
|
|
336
|
-
"url": "https://github.com/sam-github"
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
"name": "strager",
|
|
340
|
-
"url": "https://github.com/strager"
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"name": "Taylor Woll",
|
|
344
|
-
"url": "https://github.com/boingoing"
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
"name": "Thomas Gentilhomme",
|
|
348
|
-
"url": "https://github.com/fraxken"
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
"name": "Tim Rach",
|
|
352
|
-
"url": "https://github.com/timrach"
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
"name": "Tobias Nießen",
|
|
356
|
-
"url": "https://github.com/tniessen"
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"name": "todoroff",
|
|
360
|
-
"url": "https://github.com/todoroff"
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
"name": "Toyo Li",
|
|
364
|
-
"url": "https://github.com/toyobayashi"
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
"name": "Tux3",
|
|
368
|
-
"url": "https://github.com/tux3"
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
"name": "Vlad Velmisov",
|
|
372
|
-
"url": "https://github.com/Velmisov"
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
"name": "Vladimir Morozov",
|
|
376
|
-
"url": "https://github.com/vmoroz"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"name": "WenheLI",
|
|
380
|
-
"url": "https://github.com/WenheLI"
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
"name": "Xuguang Mei",
|
|
384
|
-
"url": "https://github.com/meixg"
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
"name": "Yohei Kishimoto",
|
|
388
|
-
"url": "https://github.com/morokosi"
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
"name": "Yulong Wang",
|
|
392
|
-
"url": "https://github.com/fs-eire"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
"name": "Ziqiu Zhao",
|
|
396
|
-
"url": "https://github.com/ZzqiZQute"
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"name": "Feng Yu",
|
|
400
|
-
"url": "https://github.com/F3n67u"
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
"name": "wanlu wang",
|
|
404
|
-
"url": "https://github.com/wanlu"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
"name": "Caleb Hearon",
|
|
408
|
-
"url": "https://github.com/chearon"
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
"name": "Marx",
|
|
412
|
-
"url": "https://github.com/MarxJiao"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
"name": "Ömer AKGÜL",
|
|
416
|
-
"url": "https://github.com/tuhalf"
|
|
417
|
-
}
|
|
418
|
-
],
|
|
419
|
-
"description": "Node.js API (Node-API)",
|
|
420
|
-
"devDependencies": {
|
|
421
|
-
"benchmark": "^2.1.4",
|
|
422
|
-
"bindings": "^1.5.0",
|
|
423
|
-
"clang-format": "^1.4.0",
|
|
424
|
-
"eslint": "^9.13.0",
|
|
425
|
-
"fs-extra": "^11.1.1",
|
|
426
|
-
"neostandard": "^0.12.0",
|
|
427
|
-
"pre-commit": "^1.2.2",
|
|
428
|
-
"semver": "^7.6.0"
|
|
429
|
-
},
|
|
430
|
-
"directories": {},
|
|
431
|
-
"gypfile": false,
|
|
432
|
-
"homepage": "https://github.com/nodejs/node-addon-api",
|
|
433
|
-
"keywords": [
|
|
434
|
-
"n-api",
|
|
435
|
-
"napi",
|
|
436
|
-
"addon",
|
|
437
|
-
"native",
|
|
438
|
-
"bindings",
|
|
439
|
-
"c",
|
|
440
|
-
"c++",
|
|
441
|
-
"nan",
|
|
442
|
-
"node-addon-api"
|
|
443
|
-
],
|
|
444
|
-
"license": "MIT",
|
|
445
|
-
"main": "index.js",
|
|
446
|
-
"name": "node-addon-api",
|
|
447
|
-
"readme": "README.md",
|
|
448
|
-
"repository": {
|
|
449
|
-
"type": "git",
|
|
450
|
-
"url": "git://github.com/nodejs/node-addon-api.git"
|
|
451
|
-
},
|
|
452
|
-
"files": [
|
|
453
|
-
"*.{c,h,gyp,gypi}",
|
|
454
|
-
"package-support.json",
|
|
455
|
-
"tools/"
|
|
456
|
-
],
|
|
457
|
-
"scripts": {
|
|
458
|
-
"prebenchmark": "node-gyp rebuild -C benchmark",
|
|
459
|
-
"benchmark": "node benchmark",
|
|
460
|
-
"create-coverage": "npm test --coverage",
|
|
461
|
-
"report-coverage-html": "rm -rf coverage-html && mkdir coverage-html && gcovr -e test --merge-mode-functions merge-use-line-max --html-nested ./coverage-html/index.html test",
|
|
462
|
-
"report-coverage-xml": "rm -rf coverage-xml && mkdir coverage-xml && gcovr -e test --merge-mode-functions merge-use-line-max --xml -o ./coverage-xml/coverage-cxx.xml test",
|
|
463
|
-
"pretest": "node-gyp rebuild -C test",
|
|
464
|
-
"test": "node test",
|
|
465
|
-
"test:debug": "node-gyp rebuild -C test --debug && NODE_API_BUILD_CONFIG=Debug node ./test/index.js",
|
|
466
|
-
"predev": "node-gyp rebuild -C test --debug",
|
|
467
|
-
"dev": "node test",
|
|
468
|
-
"predev:incremental": "node-gyp configure build -C test --debug",
|
|
469
|
-
"dev:incremental": "node test",
|
|
470
|
-
"doc": "doxygen doc/Doxyfile",
|
|
471
|
-
"lint": "eslint && node tools/clang-format",
|
|
472
|
-
"lint:fix": "eslint --fix && node tools/clang-format --fix"
|
|
473
|
-
},
|
|
474
|
-
"pre-commit": "lint",
|
|
475
|
-
"version": "8.5.0",
|
|
476
|
-
"support": true,
|
|
477
|
-
"engines": {
|
|
478
|
-
"node": "^18 || ^20 || >= 21"
|
|
479
|
-
}
|
|
480
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Tools
|
|
2
|
-
|
|
3
|
-
## clang-format
|
|
4
|
-
|
|
5
|
-
The clang-format checking tools is designed to check changed lines of code compared to given git-refs.
|
|
6
|
-
|
|
7
|
-
## Migration Script
|
|
8
|
-
|
|
9
|
-
The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required.
|
|
10
|
-
|
|
11
|
-
### How To Use
|
|
12
|
-
|
|
13
|
-
To run the conversion script, first make sure you have the latest `node-addon-api` in your `node_modules` directory.
|
|
14
|
-
```
|
|
15
|
-
npm install node-addon-api
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Then run the script passing your project directory
|
|
19
|
-
```
|
|
20
|
-
node ./node_modules/node-addon-api/tools/conversion.js ./
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
After finish, recompile and debug things that are missed by the script.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Quick Fixes
|
|
27
|
-
Here is the list of things that can be fixed easily.
|
|
28
|
-
1. Change your methods' return value to void if it doesn't return value to JavaScript.
|
|
29
|
-
2. Use `.` to access attribute or to invoke member function in Napi::Object instead of `->`.
|
|
30
|
-
3. `Napi::New(env, value);` to `Napi::[Type]::New(env, value);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Major Reconstructions
|
|
34
|
-
The implementation of `Napi::ObjectWrap` is significantly different from NAN's. `Napi::ObjectWrap` takes a pointer to the wrapped object and creates a reference to the wrapped object inside ObjectWrap constructor. `Napi::ObjectWrap` also associates wrapped object's instance methods to Javascript module instead of static methods like NAN.
|
|
35
|
-
|
|
36
|
-
So if you use Nan::ObjectWrap in your module, you will need to execute the following steps.
|
|
37
|
-
|
|
38
|
-
1. Convert your [ClassName]::New function to a constructor function that takes a `Napi::CallbackInfo`. Declare it as
|
|
39
|
-
```
|
|
40
|
-
[ClassName](const Napi::CallbackInfo& info);
|
|
41
|
-
```
|
|
42
|
-
and define it as
|
|
43
|
-
```
|
|
44
|
-
[ClassName]::[ClassName](const Napi::CallbackInfo& info) : Napi::ObjectWrap<[ClassName]>(info){
|
|
45
|
-
...
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
This way, the `Napi::ObjectWrap` constructor will be invoked after the object has been instantiated and `Napi::ObjectWrap` can use the `this` pointer to create a reference to the wrapped object.
|
|
49
|
-
|
|
50
|
-
2. Move your original constructor code into the new constructor. Delete your original constructor.
|
|
51
|
-
3. In your class initialization function, associate native methods in the following way.
|
|
52
|
-
```
|
|
53
|
-
Napi::FunctionReference constructor;
|
|
54
|
-
|
|
55
|
-
void [ClassName]::Init(Napi::Env env, Napi::Object exports, Napi::Object module) {
|
|
56
|
-
Napi::HandleScope scope(env);
|
|
57
|
-
Napi::Function ctor = DefineClass(env, "Canvas", {
|
|
58
|
-
InstanceMethod<&[ClassName]::Func1>("Func1"),
|
|
59
|
-
InstanceMethod<&[ClassName]::Func2>("Func2"),
|
|
60
|
-
InstanceAccessor<&[ClassName]::ValueGetter>("Value"),
|
|
61
|
-
StaticMethod<&[ClassName]::StaticMethod>("MethodName"),
|
|
62
|
-
InstanceValue("Value", Napi::[Type]::New(env, value)),
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
constructor = Napi::Persistent(ctor);
|
|
66
|
-
constructor .SuppressDestruct();
|
|
67
|
-
exports.Set("[ClassName]", ctor);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
4. In function where you need to Unwrap the ObjectWrap in NAN like `[ClassName]* native = Nan::ObjectWrap::Unwrap<[ClassName]>(info.This());`, use `this` pointer directly as the unwrapped object as each ObjectWrap instance is associated with a unique object instance.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
If you still find issues after following this guide, please leave us an issue describing your problem and we will try to resolve it.
|