novac 2.2.0 → 2.2.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.
Files changed (122) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/bin/novac +6 -3
  4. package/bin/nvc +0 -0
  5. package/bin/nvml +0 -0
  6. package/demo.nv +0 -0
  7. package/demo_builtins.nv +0 -0
  8. package/demo_http.nv +0 -0
  9. package/examples/bf.nv +5 -13
  10. package/examples/math.nv +2 -2
  11. package/kits/kitffmpeg/kitdef.js +1174 -0
  12. package/kits/libos/kitdef.js +3135 -0
  13. package/kits/libtasker/kitdef.js +125 -0
  14. package/package.json +1 -1
  15. package/scripts/update-bin.js +0 -0
  16. package/src/core/executor.js +7 -4
  17. package/src/core/lexer.js +2 -2
  18. package/src/index.js +0 -0
  19. package/novac/LICENSE +0 -21
  20. package/novac/README.md +0 -1823
  21. package/novac/bin/novac +0 -950
  22. package/novac/bin/nvc +0 -522
  23. package/novac/bin/nvml +0 -542
  24. package/novac/demo.nv +0 -245
  25. package/novac/demo_builtins.nv +0 -209
  26. package/novac/demo_http.nv +0 -62
  27. package/novac/examples/bf.nv +0 -69
  28. package/novac/examples/math.nv +0 -21
  29. package/novac/kits/kitai/kitdef.js +0 -2185
  30. package/novac/kits/kitansi/kitdef.js +0 -1402
  31. package/novac/kits/kitformat/kitdef.js +0 -1485
  32. package/novac/kits/kitgps/kitdef.js +0 -1862
  33. package/novac/kits/kitlibfs/kitdef.js +0 -231
  34. package/novac/kits/kitlibproc/kitdef.js +0 -78
  35. package/novac/kits/kitmatrix/ex.js +0 -19
  36. package/novac/kits/kitmatrix/kitdef.js +0 -960
  37. package/novac/kits/kitmpatch/kitdef.js +0 -906
  38. package/novac/kits/kitnovacweb/README.md +0 -1572
  39. package/novac/kits/kitnovacweb/demo.nv +0 -12
  40. package/novac/kits/kitnovacweb/demo.nvml +0 -71
  41. package/novac/kits/kitnovacweb/index.nova +0 -12
  42. package/novac/kits/kitnovacweb/kitdef.js +0 -692
  43. package/novac/kits/kitnovacweb/nova.kit.json +0 -8
  44. package/novac/kits/kitnovacweb/nvml/executor.js +0 -739
  45. package/novac/kits/kitnovacweb/nvml/index.js +0 -67
  46. package/novac/kits/kitnovacweb/nvml/lexer.js +0 -263
  47. package/novac/kits/kitnovacweb/nvml/parser.js +0 -508
  48. package/novac/kits/kitnovacweb/nvml/renderer.js +0 -924
  49. package/novac/kits/kitparse/kitdef.js +0 -1688
  50. package/novac/kits/kitregex++/kitdef.js +0 -1353
  51. package/novac/kits/kitrequire/kitdef.js +0 -1599
  52. package/novac/kits/kitx11/kitdef.js +0 -1
  53. package/novac/kits/kitx11/kitx11.js +0 -2472
  54. package/novac/kits/kitx11/kitx11_conn.js +0 -948
  55. package/novac/kits/kitx11/kitx11_worker.js +0 -121
  56. package/novac/kits/libtea/tf.js +0 -2691
  57. package/novac/kits/libterm/ex.js +0 -285
  58. package/novac/kits/libterm/kitdef.js +0 -1927
  59. package/novac/node_modules/chalk/license +0 -9
  60. package/novac/node_modules/chalk/package.json +0 -83
  61. package/novac/node_modules/chalk/readme.md +0 -297
  62. package/novac/node_modules/chalk/source/index.d.ts +0 -325
  63. package/novac/node_modules/chalk/source/index.js +0 -225
  64. package/novac/node_modules/chalk/source/utilities.js +0 -33
  65. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
  66. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
  67. package/novac/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  68. package/novac/node_modules/chalk/source/vendor/supports-color/browser.js +0 -34
  69. package/novac/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  70. package/novac/node_modules/chalk/source/vendor/supports-color/index.js +0 -190
  71. package/novac/node_modules/commander/LICENSE +0 -22
  72. package/novac/node_modules/commander/Readme.md +0 -1176
  73. package/novac/node_modules/commander/esm.mjs +0 -16
  74. package/novac/node_modules/commander/index.js +0 -24
  75. package/novac/node_modules/commander/lib/argument.js +0 -150
  76. package/novac/node_modules/commander/lib/command.js +0 -2777
  77. package/novac/node_modules/commander/lib/error.js +0 -39
  78. package/novac/node_modules/commander/lib/help.js +0 -747
  79. package/novac/node_modules/commander/lib/option.js +0 -380
  80. package/novac/node_modules/commander/lib/suggestSimilar.js +0 -101
  81. package/novac/node_modules/commander/package-support.json +0 -19
  82. package/novac/node_modules/commander/package.json +0 -82
  83. package/novac/node_modules/commander/typings/esm.d.mts +0 -3
  84. package/novac/node_modules/commander/typings/index.d.ts +0 -1113
  85. package/novac/node_modules/node-addon-api/LICENSE.md +0 -9
  86. package/novac/node_modules/node-addon-api/README.md +0 -95
  87. package/novac/node_modules/node-addon-api/common.gypi +0 -21
  88. package/novac/node_modules/node-addon-api/except.gypi +0 -25
  89. package/novac/node_modules/node-addon-api/index.js +0 -14
  90. package/novac/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  91. package/novac/node_modules/node-addon-api/napi-inl.h +0 -7165
  92. package/novac/node_modules/node-addon-api/napi.h +0 -3364
  93. package/novac/node_modules/node-addon-api/node_addon_api.gyp +0 -42
  94. package/novac/node_modules/node-addon-api/node_api.gyp +0 -9
  95. package/novac/node_modules/node-addon-api/noexcept.gypi +0 -26
  96. package/novac/node_modules/node-addon-api/nothing.c +0 -0
  97. package/novac/node_modules/node-addon-api/package-support.json +0 -21
  98. package/novac/node_modules/node-addon-api/package.json +0 -480
  99. package/novac/node_modules/node-addon-api/tools/README.md +0 -73
  100. package/novac/node_modules/node-addon-api/tools/check-napi.js +0 -99
  101. package/novac/node_modules/node-addon-api/tools/clang-format.js +0 -71
  102. package/novac/node_modules/node-addon-api/tools/conversion.js +0 -301
  103. package/novac/node_modules/serialize-javascript/LICENSE +0 -27
  104. package/novac/node_modules/serialize-javascript/README.md +0 -149
  105. package/novac/node_modules/serialize-javascript/index.js +0 -297
  106. package/novac/node_modules/serialize-javascript/package.json +0 -33
  107. package/novac/package.json +0 -27
  108. package/novac/scripts/update-bin.js +0 -24
  109. package/novac/src/core/bstd.js +0 -1035
  110. package/novac/src/core/config.js +0 -155
  111. package/novac/src/core/describe.js +0 -187
  112. package/novac/src/core/emitter.js +0 -499
  113. package/novac/src/core/error.js +0 -86
  114. package/novac/src/core/executor.js +0 -5606
  115. package/novac/src/core/formatter.js +0 -686
  116. package/novac/src/core/lexer.js +0 -1026
  117. package/novac/src/core/nova_builtins.js +0 -717
  118. package/novac/src/core/nova_thread_worker.js +0 -166
  119. package/novac/src/core/parser.js +0 -2181
  120. package/novac/src/core/types.js +0 -112
  121. package/novac/src/index.js +0 -28
  122. package/novac/src/runtime/stdlib.js +0 -244
@@ -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,9 +0,0 @@
1
- {
2
- 'targets': [
3
- {
4
- 'target_name': 'nothing',
5
- 'type': 'static_library',
6
- 'sources': [ 'nothing.c' ]
7
- }
8
- ]
9
- }
@@ -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.7.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.