koffi 0.9.1 → 0.9.4

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 (439) hide show
  1. package/CMakeLists.txt +2 -36
  2. package/package.json +3 -3
  3. package/vendor/dragonbox/CMakeLists.txt +123 -0
  4. package/vendor/dragonbox/LICENSE-Apache2-LLVM +218 -0
  5. package/vendor/dragonbox/LICENSE-Boost +23 -0
  6. package/vendor/dragonbox/README.md +277 -0
  7. package/vendor/dragonbox/cmake/dragonboxConfig.cmake +1 -0
  8. package/vendor/dragonbox/include/dragonbox/dragonbox.h +2670 -0
  9. package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +108 -0
  10. package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
  11. package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
  12. package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
  13. package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +540 -0
  14. package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
  15. package/vendor/dragonbox/source/dragonbox_to_chars.cpp +303 -0
  16. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +24 -0
  17. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +238 -0
  18. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +95 -0
  19. package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +2666 -0
  20. package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +16 -0
  21. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +114 -0
  22. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +509 -0
  23. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +367 -0
  24. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +357 -0
  25. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +35 -0
  26. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +345 -0
  27. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +55 -0
  28. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +128 -0
  29. package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +46 -0
  30. package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +22 -0
  31. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +699 -0
  32. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +31 -0
  33. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +1354 -0
  34. package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +31 -0
  35. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +68 -0
  36. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +25 -0
  37. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +92 -0
  38. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +121 -0
  39. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +99 -0
  40. package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +93 -0
  41. package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +65 -0
  42. package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +40 -0
  43. package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +22 -0
  44. package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +78 -0
  45. package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +95 -0
  46. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
  47. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
  48. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
  49. package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
  50. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
  51. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
  52. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
  53. package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
  54. package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +238 -0
  55. package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +30 -0
  56. package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +36 -0
  57. package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +27 -0
  58. package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +31 -0
  59. package/vendor/dragonbox/subproject/common/CMakeLists.txt +42 -0
  60. package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +97 -0
  61. package/vendor/dragonbox/subproject/common/include/big_uint.h +218 -0
  62. package/vendor/dragonbox/subproject/common/include/continued_fractions.h +174 -0
  63. package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +267 -0
  64. package/vendor/dragonbox/subproject/common/include/random_float.h +182 -0
  65. package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +57 -0
  66. package/vendor/dragonbox/subproject/common/source/big_uint.cpp +602 -0
  67. package/vendor/dragonbox/subproject/meta/CMakeLists.txt +41 -0
  68. package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +82 -0
  69. package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +10 -0
  70. package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +623 -0
  71. package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +126 -0
  72. package/vendor/dragonbox/subproject/meta/source/live_test.cpp +81 -0
  73. package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +104 -0
  74. package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +20 -0
  75. package/vendor/dragonbox/subproject/test/CMakeLists.txt +70 -0
  76. package/vendor/dragonbox/subproject/test/results/binary32.csv +255 -0
  77. package/vendor/dragonbox/subproject/test/results/binary64.csv +2047 -0
  78. package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +18 -0
  79. package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +88 -0
  80. package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +95 -0
  81. package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +338 -0
  82. package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +154 -0
  83. package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +168 -0
  84. package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +251 -0
  85. package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +113 -0
  86. package/vendor/libcc/libcc.cc +7651 -0
  87. package/vendor/libcc/libcc.hh +4312 -0
  88. package/vendor/node-addon-api/CHANGELOG.md +859 -0
  89. package/vendor/node-addon-api/CODE_OF_CONDUCT.md +4 -0
  90. package/vendor/node-addon-api/CONTRIBUTING.md +93 -0
  91. package/vendor/node-addon-api/LICENSE.md +13 -0
  92. package/vendor/node-addon-api/README.md +293 -0
  93. package/vendor/node-addon-api/appveyor.yml +37 -0
  94. package/vendor/node-addon-api/benchmark/README.md +47 -0
  95. package/vendor/node-addon-api/benchmark/binding.gyp +25 -0
  96. package/vendor/node-addon-api/benchmark/function_args.cc +217 -0
  97. package/vendor/node-addon-api/benchmark/function_args.js +60 -0
  98. package/vendor/node-addon-api/benchmark/index.js +34 -0
  99. package/vendor/node-addon-api/benchmark/property_descriptor.cc +91 -0
  100. package/vendor/node-addon-api/benchmark/property_descriptor.js +37 -0
  101. package/vendor/node-addon-api/common.gypi +21 -0
  102. package/vendor/node-addon-api/doc/addon.md +163 -0
  103. package/vendor/node-addon-api/doc/array.md +81 -0
  104. package/vendor/node-addon-api/doc/array_buffer.md +155 -0
  105. package/vendor/node-addon-api/doc/async_context.md +86 -0
  106. package/vendor/node-addon-api/doc/async_operations.md +31 -0
  107. package/vendor/node-addon-api/doc/async_worker.md +427 -0
  108. package/vendor/node-addon-api/doc/async_worker_variants.md +557 -0
  109. package/vendor/node-addon-api/doc/bigint.md +97 -0
  110. package/vendor/node-addon-api/doc/boolean.md +68 -0
  111. package/vendor/node-addon-api/doc/buffer.md +150 -0
  112. package/vendor/node-addon-api/doc/callback_scope.md +54 -0
  113. package/vendor/node-addon-api/doc/callbackinfo.md +97 -0
  114. package/vendor/node-addon-api/doc/checker-tool.md +32 -0
  115. package/vendor/node-addon-api/doc/class_property_descriptor.md +115 -0
  116. package/vendor/node-addon-api/doc/cmake-js.md +68 -0
  117. package/vendor/node-addon-api/doc/conversion-tool.md +28 -0
  118. package/vendor/node-addon-api/doc/creating_a_release.md +62 -0
  119. package/vendor/node-addon-api/doc/dataview.md +248 -0
  120. package/vendor/node-addon-api/doc/date.md +68 -0
  121. package/vendor/node-addon-api/doc/env.md +196 -0
  122. package/vendor/node-addon-api/doc/error.md +120 -0
  123. package/vendor/node-addon-api/doc/error_handling.md +254 -0
  124. package/vendor/node-addon-api/doc/escapable_handle_scope.md +80 -0
  125. package/vendor/node-addon-api/doc/external.md +63 -0
  126. package/vendor/node-addon-api/doc/function.md +402 -0
  127. package/vendor/node-addon-api/doc/function_reference.md +238 -0
  128. package/vendor/node-addon-api/doc/generator.md +13 -0
  129. package/vendor/node-addon-api/doc/handle_scope.md +63 -0
  130. package/vendor/node-addon-api/doc/hierarchy.md +91 -0
  131. package/vendor/node-addon-api/doc/instance_wrap.md +408 -0
  132. package/vendor/node-addon-api/doc/maybe.md +76 -0
  133. package/vendor/node-addon-api/doc/memory_management.md +27 -0
  134. package/vendor/node-addon-api/doc/name.md +29 -0
  135. package/vendor/node-addon-api/doc/node-gyp.md +82 -0
  136. package/vendor/node-addon-api/doc/number.md +163 -0
  137. package/vendor/node-addon-api/doc/object.md +432 -0
  138. package/vendor/node-addon-api/doc/object_lifetime_management.md +83 -0
  139. package/vendor/node-addon-api/doc/object_reference.md +117 -0
  140. package/vendor/node-addon-api/doc/object_wrap.md +561 -0
  141. package/vendor/node-addon-api/doc/prebuild_tools.md +16 -0
  142. package/vendor/node-addon-api/doc/promises.md +79 -0
  143. package/vendor/node-addon-api/doc/property_descriptor.md +286 -0
  144. package/vendor/node-addon-api/doc/propertylvalue.md +50 -0
  145. package/vendor/node-addon-api/doc/range_error.md +59 -0
  146. package/vendor/node-addon-api/doc/reference.md +113 -0
  147. package/vendor/node-addon-api/doc/setup.md +110 -0
  148. package/vendor/node-addon-api/doc/string.md +93 -0
  149. package/vendor/node-addon-api/doc/symbol.md +61 -0
  150. package/vendor/node-addon-api/doc/threadsafe.md +121 -0
  151. package/vendor/node-addon-api/doc/threadsafe_function.md +290 -0
  152. package/vendor/node-addon-api/doc/type_error.md +59 -0
  153. package/vendor/node-addon-api/doc/typed_array.md +78 -0
  154. package/vendor/node-addon-api/doc/typed_array_of.md +137 -0
  155. package/vendor/node-addon-api/doc/typed_threadsafe_function.md +306 -0
  156. package/vendor/node-addon-api/doc/value.md +340 -0
  157. package/vendor/node-addon-api/doc/version_management.md +43 -0
  158. package/vendor/node-addon-api/except.gypi +25 -0
  159. package/vendor/node-addon-api/index.js +11 -0
  160. package/vendor/node-addon-api/napi-inl.deprecated.h +192 -0
  161. package/vendor/node-addon-api/napi-inl.h +6209 -0
  162. package/vendor/node-addon-api/napi.h +2983 -0
  163. package/vendor/node-addon-api/node_api.gyp +9 -0
  164. package/vendor/node-addon-api/noexcept.gypi +26 -0
  165. package/vendor/node-addon-api/nothing.c +0 -0
  166. package/vendor/node-addon-api/package-support.json +21 -0
  167. package/vendor/node-addon-api/package.json +399 -0
  168. package/vendor/node-addon-api/test/README.md +91 -0
  169. package/vendor/node-addon-api/test/addon.cc +36 -0
  170. package/vendor/node-addon-api/test/addon.js +11 -0
  171. package/vendor/node-addon-api/test/addon_build/index.js +49 -0
  172. package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +17 -0
  173. package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +62 -0
  174. package/vendor/node-addon-api/test/addon_build/tpl/index.js +9 -0
  175. package/vendor/node-addon-api/test/addon_build/tpl/package.json +11 -0
  176. package/vendor/node-addon-api/test/addon_data.cc +99 -0
  177. package/vendor/node-addon-api/test/addon_data.js +46 -0
  178. package/vendor/node-addon-api/test/array_buffer.cc +243 -0
  179. package/vendor/node-addon-api/test/array_buffer.js +69 -0
  180. package/vendor/node-addon-api/test/async_context.cc +21 -0
  181. package/vendor/node-addon-api/test/async_context.js +86 -0
  182. package/vendor/node-addon-api/test/async_progress_queue_worker.cc +83 -0
  183. package/vendor/node-addon-api/test/async_progress_queue_worker.js +46 -0
  184. package/vendor/node-addon-api/test/async_progress_worker.cc +134 -0
  185. package/vendor/node-addon-api/test/async_progress_worker.js +61 -0
  186. package/vendor/node-addon-api/test/async_worker.cc +106 -0
  187. package/vendor/node-addon-api/test/async_worker.js +179 -0
  188. package/vendor/node-addon-api/test/async_worker_nocallback.js +13 -0
  189. package/vendor/node-addon-api/test/async_worker_persistent.cc +63 -0
  190. package/vendor/node-addon-api/test/async_worker_persistent.js +24 -0
  191. package/vendor/node-addon-api/test/basic_types/array.cc +40 -0
  192. package/vendor/node-addon-api/test/basic_types/array.js +35 -0
  193. package/vendor/node-addon-api/test/basic_types/boolean.cc +38 -0
  194. package/vendor/node-addon-api/test/basic_types/boolean.js +35 -0
  195. package/vendor/node-addon-api/test/basic_types/number.cc +99 -0
  196. package/vendor/node-addon-api/test/basic_types/number.js +114 -0
  197. package/vendor/node-addon-api/test/basic_types/value.cc +120 -0
  198. package/vendor/node-addon-api/test/basic_types/value.js +133 -0
  199. package/vendor/node-addon-api/test/bigint.cc +91 -0
  200. package/vendor/node-addon-api/test/bigint.js +53 -0
  201. package/vendor/node-addon-api/test/binding-swallowexcept.cc +12 -0
  202. package/vendor/node-addon-api/test/binding.cc +171 -0
  203. package/vendor/node-addon-api/test/binding.gyp +117 -0
  204. package/vendor/node-addon-api/test/buffer.cc +183 -0
  205. package/vendor/node-addon-api/test/buffer.js +69 -0
  206. package/vendor/node-addon-api/test/callbackscope.cc +22 -0
  207. package/vendor/node-addon-api/test/callbackscope.js +49 -0
  208. package/vendor/node-addon-api/test/common/index.js +113 -0
  209. package/vendor/node-addon-api/test/common/test_helper.h +61 -0
  210. package/vendor/node-addon-api/test/dataview/dataview.cc +48 -0
  211. package/vendor/node-addon-api/test/dataview/dataview.js +35 -0
  212. package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +115 -0
  213. package/vendor/node-addon-api/test/dataview/dataview_read_write.js +90 -0
  214. package/vendor/node-addon-api/test/date.cc +44 -0
  215. package/vendor/node-addon-api/test/date.js +18 -0
  216. package/vendor/node-addon-api/test/env_cleanup.cc +88 -0
  217. package/vendor/node-addon-api/test/env_cleanup.js +56 -0
  218. package/vendor/node-addon-api/test/error.cc +287 -0
  219. package/vendor/node-addon-api/test/error.js +81 -0
  220. package/vendor/node-addon-api/test/error_handling_for_primitives.cc +13 -0
  221. package/vendor/node-addon-api/test/error_handling_for_primitives.js +29 -0
  222. package/vendor/node-addon-api/test/error_terminating_environment.js +94 -0
  223. package/vendor/node-addon-api/test/external.cc +81 -0
  224. package/vendor/node-addon-api/test/external.js +88 -0
  225. package/vendor/node-addon-api/test/function.cc +295 -0
  226. package/vendor/node-addon-api/test/function.js +121 -0
  227. package/vendor/node-addon-api/test/function_reference.cc +202 -0
  228. package/vendor/node-addon-api/test/function_reference.js +157 -0
  229. package/vendor/node-addon-api/test/globalObject/global_object.cc +61 -0
  230. package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +31 -0
  231. package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +61 -0
  232. package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +40 -0
  233. package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +57 -0
  234. package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +28 -0
  235. package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +48 -0
  236. package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +31 -0
  237. package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +58 -0
  238. package/vendor/node-addon-api/test/handlescope.cc +60 -0
  239. package/vendor/node-addon-api/test/handlescope.js +14 -0
  240. package/vendor/node-addon-api/test/index.js +136 -0
  241. package/vendor/node-addon-api/test/maybe/check.cc +23 -0
  242. package/vendor/node-addon-api/test/maybe/index.js +38 -0
  243. package/vendor/node-addon-api/test/memory_management.cc +17 -0
  244. package/vendor/node-addon-api/test/memory_management.js +9 -0
  245. package/vendor/node-addon-api/test/movable_callbacks.cc +23 -0
  246. package/vendor/node-addon-api/test/movable_callbacks.js +21 -0
  247. package/vendor/node-addon-api/test/name.cc +108 -0
  248. package/vendor/node-addon-api/test/name.js +59 -0
  249. package/vendor/node-addon-api/test/napi_child.js +14 -0
  250. package/vendor/node-addon-api/test/object/delete_property.cc +38 -0
  251. package/vendor/node-addon-api/test/object/delete_property.js +41 -0
  252. package/vendor/node-addon-api/test/object/finalizer.cc +29 -0
  253. package/vendor/node-addon-api/test/object/finalizer.js +28 -0
  254. package/vendor/node-addon-api/test/object/get_property.cc +34 -0
  255. package/vendor/node-addon-api/test/object/get_property.js +40 -0
  256. package/vendor/node-addon-api/test/object/has_own_property.cc +34 -0
  257. package/vendor/node-addon-api/test/object/has_own_property.js +34 -0
  258. package/vendor/node-addon-api/test/object/has_property.cc +38 -0
  259. package/vendor/node-addon-api/test/object/has_property.js +37 -0
  260. package/vendor/node-addon-api/test/object/object.cc +348 -0
  261. package/vendor/node-addon-api/test/object/object.js +217 -0
  262. package/vendor/node-addon-api/test/object/object_deprecated.cc +66 -0
  263. package/vendor/node-addon-api/test/object/object_deprecated.js +47 -0
  264. package/vendor/node-addon-api/test/object/object_freeze_seal.cc +25 -0
  265. package/vendor/node-addon-api/test/object/object_freeze_seal.js +61 -0
  266. package/vendor/node-addon-api/test/object/set_property.cc +37 -0
  267. package/vendor/node-addon-api/test/object/set_property.js +29 -0
  268. package/vendor/node-addon-api/test/object/subscript_operator.cc +42 -0
  269. package/vendor/node-addon-api/test/object/subscript_operator.js +17 -0
  270. package/vendor/node-addon-api/test/object_reference.cc +219 -0
  271. package/vendor/node-addon-api/test/object_reference.js +259 -0
  272. package/vendor/node-addon-api/test/objectwrap.cc +268 -0
  273. package/vendor/node-addon-api/test/objectwrap.js +284 -0
  274. package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +26 -0
  275. package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +18 -0
  276. package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +30 -0
  277. package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +13 -0
  278. package/vendor/node-addon-api/test/objectwrap_removewrap.cc +45 -0
  279. package/vendor/node-addon-api/test/objectwrap_removewrap.js +40 -0
  280. package/vendor/node-addon-api/test/objectwrap_worker_thread.js +19 -0
  281. package/vendor/node-addon-api/test/promise.cc +29 -0
  282. package/vendor/node-addon-api/test/promise.js +18 -0
  283. package/vendor/node-addon-api/test/reference.cc +24 -0
  284. package/vendor/node-addon-api/test/reference.js +14 -0
  285. package/vendor/node-addon-api/test/run_script.cc +56 -0
  286. package/vendor/node-addon-api/test/run_script.js +45 -0
  287. package/vendor/node-addon-api/test/symbol.cc +79 -0
  288. package/vendor/node-addon-api/test/symbol.js +73 -0
  289. package/vendor/node-addon-api/test/testUtil.js +54 -0
  290. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +195 -0
  291. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +188 -0
  292. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +63 -0
  293. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +12 -0
  294. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +115 -0
  295. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +14 -0
  296. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +26 -0
  297. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +7 -0
  298. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +225 -0
  299. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +59 -0
  300. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +42 -0
  301. package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +53 -0
  302. package/vendor/node-addon-api/test/thunking_manual.cc +140 -0
  303. package/vendor/node-addon-api/test/thunking_manual.js +17 -0
  304. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +215 -0
  305. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +188 -0
  306. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +68 -0
  307. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +12 -0
  308. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +127 -0
  309. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +14 -0
  310. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +28 -0
  311. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +7 -0
  312. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +237 -0
  313. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +59 -0
  314. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +53 -0
  315. package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +53 -0
  316. package/vendor/node-addon-api/test/typedarray-bigint.js +58 -0
  317. package/vendor/node-addon-api/test/typedarray.cc +216 -0
  318. package/vendor/node-addon-api/test/typedarray.js +69 -0
  319. package/vendor/node-addon-api/test/version_management.cc +27 -0
  320. package/vendor/node-addon-api/test/version_management.js +31 -0
  321. package/vendor/node-addon-api/tools/README.md +73 -0
  322. package/vendor/node-addon-api/tools/check-napi.js +100 -0
  323. package/vendor/node-addon-api/tools/clang-format.js +68 -0
  324. package/vendor/node-addon-api/tools/conversion.js +309 -0
  325. package/vendor/node-addon-api/tools/eslint-format.js +71 -0
  326. package/build/ALL_BUILD.vcxproj +0 -190
  327. package/build/ALL_BUILD.vcxproj.filters +0 -8
  328. package/build/CMakeCache.txt +0 -429
  329. package/build/CMakeFiles/3.23.0-rc1/CMakeASMCompiler.cmake +0 -20
  330. package/build/CMakeFiles/3.23.0-rc1/CMakeASM_MASMCompiler.cmake +0 -20
  331. package/build/CMakeFiles/3.23.0-rc1/CMakeCCompiler.cmake +0 -72
  332. package/build/CMakeFiles/3.23.0-rc1/CMakeCXXCompiler.cmake +0 -83
  333. package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_C.bin +0 -0
  334. package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_CXX.bin +0 -0
  335. package/build/CMakeFiles/3.23.0-rc1/CMakeRCCompiler.cmake +0 -6
  336. package/build/CMakeFiles/3.23.0-rc1/CMakeSystem.cmake +0 -15
  337. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CMakeCCompilerId.c +0 -828
  338. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.exe +0 -0
  339. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.vcxproj +0 -71
  340. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CMakeCCompilerId.obj +0 -0
  341. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.exe.recipe +0 -11
  342. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.command.1.tlog +0 -0
  343. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.read.1.tlog +0 -0
  344. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.write.1.tlog +0 -0
  345. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CompilerIdC.lastbuildstate +0 -2
  346. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.command.1.tlog +0 -0
  347. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.read.1.tlog +0 -0
  348. package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.write.1.tlog +0 -0
  349. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -816
  350. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.exe +0 -0
  351. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.vcxproj +0 -71
  352. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj +0 -0
  353. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.exe.recipe +0 -11
  354. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.command.1.tlog +0 -0
  355. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.read.1.tlog +0 -0
  356. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.write.1.tlog +0 -0
  357. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate +0 -2
  358. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.command.1.tlog +0 -0
  359. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.read.1.tlog +0 -0
  360. package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.write.1.tlog +0 -0
  361. package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.txt +0 -1
  362. package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.vcxproj +0 -31
  363. package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.recipe +0 -11
  364. package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.tlog/VCTargetsPath.lastbuildstate +0 -2
  365. package/build/CMakeFiles/41bcd16856091d4a38fd1f71fbe2f202/generate.stamp.rule +0 -1
  366. package/build/CMakeFiles/CMakeError.log +0 -108
  367. package/build/CMakeFiles/CMakeOutput.log +0 -413
  368. package/build/CMakeFiles/TargetDirectories.txt +0 -4
  369. package/build/CMakeFiles/cmake.check_cache +0 -1
  370. package/build/CMakeFiles/generate.stamp +0 -1
  371. package/build/CMakeFiles/generate.stamp.depend +0 -28
  372. package/build/CMakeFiles/generate.stamp.list +0 -1
  373. package/build/Raylib.dir/Release/Raylib.dll.recipe +0 -14
  374. package/build/Raylib.dir/Release/Raylib.tlog/CL.command.1.tlog +0 -0
  375. package/build/Raylib.dir/Release/Raylib.tlog/CL.read.1.tlog +0 -0
  376. package/build/Raylib.dir/Release/Raylib.tlog/CL.write.1.tlog +0 -0
  377. package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.command.1.tlog +0 -10
  378. package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.read.1.tlog +0 -27
  379. package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.write.1.tlog +0 -2
  380. package/build/Raylib.dir/Release/Raylib.tlog/Raylib.lastbuildstate +0 -2
  381. package/build/Raylib.dir/Release/Raylib.tlog/Raylib.write.1u.tlog +0 -0
  382. package/build/Raylib.dir/Release/Raylib.tlog/link.command.1.tlog +0 -0
  383. package/build/Raylib.dir/Release/Raylib.tlog/link.read.1.tlog +0 -0
  384. package/build/Raylib.dir/Release/Raylib.tlog/link.write.1.tlog +0 -0
  385. package/build/Raylib.dir/Release/raudio.obj +0 -0
  386. package/build/Raylib.dir/Release/rcore.obj +0 -0
  387. package/build/Raylib.dir/Release/rglfw.obj +0 -0
  388. package/build/Raylib.dir/Release/rmodels.obj +0 -0
  389. package/build/Raylib.dir/Release/rshapes.obj +0 -0
  390. package/build/Raylib.dir/Release/rtext.obj +0 -0
  391. package/build/Raylib.dir/Release/rtextures.obj +0 -0
  392. package/build/Raylib.dir/Release/utils.obj +0 -0
  393. package/build/Raylib.vcxproj +0 -358
  394. package/build/Raylib.vcxproj.filters +0 -37
  395. package/build/Release/Raylib.dll +0 -0
  396. package/build/Release/Raylib.exp +0 -0
  397. package/build/Release/Raylib.lib +0 -0
  398. package/build/Release/koffi.exp +0 -0
  399. package/build/Release/koffi.lib +0 -0
  400. package/build/Release/koffi.node +0 -0
  401. package/build/ZERO_CHECK.vcxproj +0 -176
  402. package/build/ZERO_CHECK.vcxproj.filters +0 -13
  403. package/build/cmake_install.cmake +0 -44
  404. package/build/koffi.dir/Release/call_arm64.obj +0 -0
  405. package/build/koffi.dir/Release/call_x64_sysv.obj +0 -0
  406. package/build/koffi.dir/Release/call_x64_win.obj +0 -0
  407. package/build/koffi.dir/Release/call_x64_win_fwd.obj +0 -0
  408. package/build/koffi.dir/Release/call_x86.obj +0 -0
  409. package/build/koffi.dir/Release/ffi.obj +0 -0
  410. package/build/koffi.dir/Release/koffi.node.recipe +0 -14
  411. package/build/koffi.dir/Release/koffi.tlog/CL.command.1.tlog +0 -0
  412. package/build/koffi.dir/Release/koffi.tlog/CL.read.1.tlog +0 -0
  413. package/build/koffi.dir/Release/koffi.tlog/CL.write.1.tlog +0 -0
  414. package/build/koffi.dir/Release/koffi.tlog/CustomBuild.command.1.tlog +0 -10
  415. package/build/koffi.dir/Release/koffi.tlog/CustomBuild.read.1.tlog +0 -27
  416. package/build/koffi.dir/Release/koffi.tlog/CustomBuild.write.1.tlog +0 -2
  417. package/build/koffi.dir/Release/koffi.tlog/Masm.read.1u.tlog +0 -0
  418. package/build/koffi.dir/Release/koffi.tlog/Masm.write.1u.tlog +0 -0
  419. package/build/koffi.dir/Release/koffi.tlog/koffi.lastbuildstate +0 -2
  420. package/build/koffi.dir/Release/koffi.tlog/koffi.write.1u.tlog +0 -0
  421. package/build/koffi.dir/Release/koffi.tlog/link.command.1.tlog +0 -0
  422. package/build/koffi.dir/Release/koffi.tlog/link.read.1.tlog +0 -0
  423. package/build/koffi.dir/Release/koffi.tlog/link.write.1.tlog +0 -0
  424. package/build/koffi.dir/Release/libcc.obj +0 -0
  425. package/build/koffi.dir/Release/util.obj +0 -0
  426. package/build/koffi.dir/Release/win_delay_load_hook.obj +0 -0
  427. package/build/koffi.sln +0 -67
  428. package/build/koffi.vcxproj +0 -363
  429. package/build/koffi.vcxproj.filters +0 -40
  430. package/build/x64/Release/ALL_BUILD/ALL_BUILD.recipe +0 -20
  431. package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/ALL_BUILD.lastbuildstate +0 -2
  432. package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.command.1.tlog +0 -10
  433. package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.read.1.tlog +0 -27
  434. package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.write.1.tlog +0 -2
  435. package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.recipe +0 -11
  436. package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.command.1.tlog +0 -10
  437. package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.read.1.tlog +0 -28
  438. package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.write.1.tlog +0 -2
  439. package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate +0 -2
@@ -0,0 +1,4 @@
1
+ # Code of Conduct
2
+
3
+ The Node.js Code of Conduct, which applies to this project, can be found at
4
+ https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md.
@@ -0,0 +1,93 @@
1
+
2
+ # Developer's Certificate of Origin 1.1
3
+
4
+ By making a contribution to this project, I certify that:
5
+
6
+ (a) The contribution was created in whole or in part by me and I
7
+ have the right to submit it under the open source license
8
+ indicated in the file; or
9
+
10
+ (b) The contribution is based upon previous work that, to the best
11
+ of my knowledge, is covered under an appropriate open source
12
+ license and I have the right under that license to submit that
13
+ work with modifications, whether created in whole or in part
14
+ by me, under the same open source license (unless I am
15
+ permitted to submit under a different license), as indicated
16
+ in the file; or
17
+
18
+ (c) The contribution was provided directly to me by some other
19
+ person who certified (a), (b) or (c) and I have not modified
20
+ it.
21
+
22
+ (d) I understand and agree that this project and the contribution
23
+ are public and that a record of the contribution (including all
24
+ personal information I submit with it, including my sign-off) is
25
+ maintained indefinitely and may be redistributed consistent with
26
+ this project or the open source license(s) involved.
27
+
28
+ # **node-addon-api** Contribution Philosophy
29
+
30
+ The **node-addon-api** team loves contributions. There are many ways in which you can
31
+ contribute to **node-addon-api**:
32
+ - Source code fixes
33
+ - Additional tests
34
+ - Documentation improvements
35
+ - Joining the Node-API working group and participating in meetings
36
+
37
+ ## Source changes
38
+
39
+ **node-addon-api** is meant to be a thin convenience wrapper around Node-API. With this
40
+ in mind, contributions of any new APIs that wrap around a core Node-API API will
41
+ be considered for merge. However, changes that wrap existing **node-addon-api**
42
+ APIs are encouraged to instead be provided as an ecosystem module. The
43
+ **node-addon-api** team is happy to link to a curated set of modules that build on
44
+ top of **node-addon-api** if they have broad usefulness to the community and promote
45
+ a recommended idiom or pattern.
46
+
47
+ ### Rationale
48
+
49
+ The Node-API team considered a couple different approaches with regards to changes
50
+ extending **node-addon-api**
51
+ - Larger core module - Incorporate these helpers and patterns into **node-addon-api**
52
+ - Extras package - Create a new package (strawman name '**node-addon-api**-extras')
53
+ that contain utility classes and methods that help promote good patterns and
54
+ idioms while writing native addons with **node-addon-api**.
55
+ - Ecosystem - Encourage creation of a module ecosystem around **node-addon-api**
56
+ where folks can build on top of it.
57
+
58
+ #### Larger Core
59
+ This is probably our simplest option in terms of immediate action needed. It
60
+ would involve landing any open PRs against **node-addon-api**, and continuing to
61
+ encourage folks to make PRs for utility helpers against the same repository.
62
+
63
+ The downside of the approach is the following:
64
+ - Less coherency for our API set
65
+ - More maintenance burden on the Node-API WG core team.
66
+
67
+ #### Extras Package
68
+ This involves us spinning up a new package which contains the utility classes
69
+ and methods. This has the benefit of having a separate module where helpers
70
+ which make it easier to implement certain patterns and idioms for native addons
71
+ easier.
72
+
73
+ The downside of this approach is the following:
74
+ - Potential for confusion - we'll need to provide clear documentation to help the
75
+ community understand where a particular contribution should be directed to (what
76
+ belongs in **node-addon-api** vs **node-addon-api-extras**)
77
+ - Need to define the level of support/API guarantees
78
+ - Unclear if the maintenance burden on the Node-API WG is reduced or not
79
+
80
+ #### Ecosystem
81
+ This doesn't require a ton of up-front work from the Node-API WG. Instead of
82
+ accepting utility PRs into **node-addon-api** or creating and maintaining a new
83
+ module, the WG will encourage the creation of an ecosystem of modules that
84
+ build on top of **node-addon-api**, and provide some level of advertising for these
85
+ modules (listing them out on the repository/wiki, using them in workshops/tutorials
86
+ etc).
87
+
88
+ The downside of this approach is the following:
89
+ - Potential for lack of visibility - evangelism and education is hard, and module
90
+ authors might not find right patterns and instead implement things themselves
91
+ - There might be greater friction for the Node-API WG in evolving APIs since the
92
+ ecosystem would have taken dependencies on the API shape of **node-addon-api**
93
+
@@ -0,0 +1,13 @@
1
+ The MIT License (MIT)
2
+ =====================
3
+
4
+ Copyright (c) 2017 Node.js API collaborators
5
+ -----------------------------------
6
+
7
+ *Node.js API collaborators listed at <https://github.com/nodejs/node-addon-api#collaborators>*
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,293 @@
1
+ NOTE: The default branch has been renamed!
2
+ master is now named main
3
+
4
+ If you have a local clone, you can update it by running:
5
+
6
+ ```shell
7
+ git branch -m master main
8
+ git fetch origin
9
+ git branch -u origin/main main
10
+ ```
11
+
12
+ # **node-addon-api module**
13
+ This module contains **header-only C++ wrapper classes** which simplify
14
+ the use of the C based [Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
15
+ provided by Node.js when using C++. It provides a C++ object model
16
+ and exception handling semantics with low overhead.
17
+
18
+ There are three options for implementing addons: Node-API, nan, or direct
19
+ use of internal V8, libuv and Node.js libraries. Unless there is a need for
20
+ direct access to functionality which is not exposed by Node-API as outlined
21
+ in [C/C++ addons](https://nodejs.org/dist/latest/docs/api/addons.html)
22
+ in Node.js core, use Node-API. Refer to
23
+ [C/C++ addons with Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)
24
+ for more information on Node-API.
25
+
26
+ Node-API is an ABI stable C interface provided by Node.js for building native
27
+ addons. It is independent from the underlying JavaScript runtime (e.g. V8 or ChakraCore)
28
+ and is maintained as part of Node.js itself. It is intended to insulate
29
+ native addons from changes in the underlying JavaScript engine and allow
30
+ modules compiled for one version to run on later versions of Node.js without
31
+ recompilation.
32
+
33
+ The `node-addon-api` module, which is not part of Node.js, preserves the benefits
34
+ of the Node-API as it consists only of inline code that depends only on the stable API
35
+ provided by Node-API. As such, modules built against one version of Node.js
36
+ using node-addon-api should run without having to be rebuilt with newer versions
37
+ of Node.js.
38
+
39
+ It is important to remember that *other* Node.js interfaces such as
40
+ `libuv` (included in a project via `#include <uv.h>`) are not ABI-stable across
41
+ Node.js major versions. Thus, an addon must use Node-API and/or `node-addon-api`
42
+ exclusively and build against a version of Node.js that includes an
43
+ implementation of Node-API (meaning an active LTS version of Node.js) in
44
+ order to benefit from ABI stability across Node.js major versions. Node.js
45
+ provides an [ABI stability guide][] containing a detailed explanation of ABI
46
+ stability in general, and the Node-API ABI stability guarantee in particular.
47
+
48
+ As new APIs are added to Node-API, node-addon-api must be updated to provide
49
+ wrappers for those new APIs. For this reason node-addon-api provides
50
+ methods that allow callers to obtain the underlying Node-API handles so
51
+ direct calls to Node-API and the use of the objects/methods provided by
52
+ node-addon-api can be used together. For example, in order to be able
53
+ to use an API for which the node-addon-api does not yet provide a wrapper.
54
+
55
+ APIs exposed by node-addon-api are generally used to create and
56
+ manipulate JavaScript values. Concepts and operations generally map
57
+ to ideas specified in the **ECMA262 Language Specification**.
58
+
59
+ The [Node-API Resource](https://nodejs.github.io/node-addon-examples/) offers an
60
+ excellent orientation and tips for developers just getting started with Node-API
61
+ and node-addon-api.
62
+
63
+ - **[Setup](#setup)**
64
+ - **[API Documentation](#api)**
65
+ - **[Examples](#examples)**
66
+ - **[Tests](#tests)**
67
+ - **[More resource and info about native Addons](#resources)**
68
+ - **[Badges](#badges)**
69
+ - **[Code of Conduct](CODE_OF_CONDUCT.md)**
70
+ - **[Contributors](#contributors)**
71
+ - **[License](#license)**
72
+
73
+ ## **Current version: 4.3.0**
74
+
75
+ (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)
76
+
77
+ [![NPM](https://nodei.co/npm/node-addon-api.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-addon-api/) [![NPM](https://nodei.co/npm-dl/node-addon-api.png?months=6&height=1)](https://nodei.co/npm/node-addon-api/)
78
+
79
+ <a name="setup"></a>
80
+
81
+ node-addon-api is based on [Node-API](https://nodejs.org/api/n-api.html) and supports using different Node-API versions.
82
+ This allows addons built with it to run with Node.js versions which support the targeted Node-API version.
83
+ **However** the node-addon-api support model is to support only the active LTS Node.js versions. This means that
84
+ every year there will be a new major which drops support for the Node.js LTS version which has gone out of service.
85
+
86
+ The oldest Node.js version supported by the current version of node-addon-api is Node.js 12.x.
87
+
88
+ ## Setup
89
+ - [Installation and usage](doc/setup.md)
90
+ - [node-gyp](doc/node-gyp.md)
91
+ - [cmake-js](doc/cmake-js.md)
92
+ - [Conversion tool](doc/conversion-tool.md)
93
+ - [Checker tool](doc/checker-tool.md)
94
+ - [Generator](doc/generator.md)
95
+ - [Prebuild tools](doc/prebuild_tools.md)
96
+
97
+ <a name="api"></a>
98
+
99
+ ### **API Documentation**
100
+
101
+ The following is the documentation for node-addon-api.
102
+
103
+ - [Full Class Hierarchy](doc/hierarchy.md)
104
+ - [Addon Structure](doc/addon.md)
105
+ - Data Types:
106
+ - [Env](doc/env.md)
107
+ - [CallbackInfo](doc/callbackinfo.md)
108
+ - [Reference](doc/reference.md)
109
+ - [Value](doc/value.md)
110
+ - [Name](doc/name.md)
111
+ - [Symbol](doc/symbol.md)
112
+ - [String](doc/string.md)
113
+ - [Number](doc/number.md)
114
+ - [Date](doc/date.md)
115
+ - [BigInt](doc/bigint.md)
116
+ - [Boolean](doc/boolean.md)
117
+ - [External](doc/external.md)
118
+ - [Object](doc/object.md)
119
+ - [Array](doc/array.md)
120
+ - [ObjectReference](doc/object_reference.md)
121
+ - [PropertyDescriptor](doc/property_descriptor.md)
122
+ - [Function](doc/function.md)
123
+ - [FunctionReference](doc/function_reference.md)
124
+ - [ObjectWrap](doc/object_wrap.md)
125
+ - [ClassPropertyDescriptor](doc/class_property_descriptor.md)
126
+ - [Buffer](doc/buffer.md)
127
+ - [ArrayBuffer](doc/array_buffer.md)
128
+ - [TypedArray](doc/typed_array.md)
129
+ - [TypedArrayOf](doc/typed_array_of.md)
130
+ - [DataView](doc/dataview.md)
131
+ - [Error Handling](doc/error_handling.md)
132
+ - [Error](doc/error.md)
133
+ - [TypeError](doc/type_error.md)
134
+ - [RangeError](doc/range_error.md)
135
+ - [Object Lifetime Management](doc/object_lifetime_management.md)
136
+ - [HandleScope](doc/handle_scope.md)
137
+ - [EscapableHandleScope](doc/escapable_handle_scope.md)
138
+ - [Memory Management](doc/memory_management.md)
139
+ - [Async Operations](doc/async_operations.md)
140
+ - [AsyncWorker](doc/async_worker.md)
141
+ - [AsyncContext](doc/async_context.md)
142
+ - [AsyncWorker Variants](doc/async_worker_variants.md)
143
+ - [Thread-safe Functions](doc/threadsafe.md)
144
+ - [ThreadSafeFunction](doc/threadsafe_function.md)
145
+ - [TypedThreadSafeFunction](doc/typed_threadsafe_function.md)
146
+ - [Promises](doc/promises.md)
147
+ - [Version management](doc/version_management.md)
148
+
149
+ <a name="examples"></a>
150
+
151
+ ### **Examples**
152
+
153
+ Are you new to **node-addon-api**? Take a look at our **[examples](https://github.com/nodejs/node-addon-examples)**
154
+
155
+ - **[Hello World](https://github.com/nodejs/node-addon-examples/tree/HEAD/1_hello_world/node-addon-api)**
156
+ - **[Pass arguments to a function](https://github.com/nodejs/node-addon-examples/tree/HEAD/2_function_arguments/node-addon-api)**
157
+ - **[Callbacks](https://github.com/nodejs/node-addon-examples/tree/HEAD/3_callbacks/node-addon-api)**
158
+ - **[Object factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/4_object_factory/node-addon-api)**
159
+ - **[Function factory](https://github.com/nodejs/node-addon-examples/tree/HEAD/5_function_factory/node-addon-api)**
160
+ - **[Wrapping C++ Object](https://github.com/nodejs/node-addon-examples/tree/HEAD/6_object_wrap/node-addon-api)**
161
+ - **[Factory of wrapped object](https://github.com/nodejs/node-addon-examples/tree/HEAD/7_factory_wrap/node-addon-api)**
162
+ - **[Passing wrapped object around](https://github.com/nodejs/node-addon-examples/tree/HEAD/8_passing_wrapped/node-addon-api)**
163
+
164
+ <a name="tests"></a>
165
+
166
+ ### **Tests**
167
+
168
+ To run the **node-addon-api** tests do:
169
+
170
+ ```
171
+ npm install
172
+ npm test
173
+ ```
174
+
175
+ To avoid testing the deprecated portions of the API run
176
+ ```
177
+ npm install
178
+ npm test --disable-deprecated
179
+ ```
180
+
181
+ To run the tests targeting a specific version of Node-API run
182
+ ```
183
+ npm install
184
+ export NAPI_VERSION=X
185
+ npm test --NAPI_VERSION=X
186
+ ```
187
+
188
+ where X is the version of Node-API you want to target.
189
+
190
+ ### **Debug**
191
+
192
+ To run the **node-addon-api** tests with `--debug` option:
193
+
194
+ ```
195
+ npm run-script dev
196
+ ```
197
+
198
+ If you want faster build, you might use the following option:
199
+
200
+ ```
201
+ npm run-script dev:incremental
202
+ ```
203
+
204
+ Take a look and get inspired by our **[test suite](https://github.com/nodejs/node-addon-api/tree/HEAD/test)**
205
+
206
+ ### **Benchmarks**
207
+
208
+ You can run the available benchmarks using the following command:
209
+
210
+ ```
211
+ npm run-script benchmark
212
+ ```
213
+
214
+ See [benchmark/README.md](benchmark/README.md) for more details about running and adding benchmarks.
215
+
216
+ <a name="resources"></a>
217
+
218
+ ### **More resource and info about native Addons**
219
+ - **[C++ Addons](https://nodejs.org/dist/latest/docs/api/addons.html)**
220
+ - **[Node-API](https://nodejs.org/dist/latest/docs/api/n-api.html)**
221
+ - **[Node-API - Next Generation Node API for Native Modules](https://youtu.be/-Oniup60Afs)**
222
+ - **[How We Migrated Realm JavaScript From NAN to Node-API](https://developer.mongodb.com/article/realm-javascript-nan-to-n-api)**
223
+
224
+ As node-addon-api's core mission is to expose the plain C Node-API as C++
225
+ wrappers, tools that facilitate n-api/node-addon-api providing more
226
+ convenient patterns on developing a Node.js add-ons with n-api/node-addon-api
227
+ can be published to NPM as standalone packages. It is also recommended to tag
228
+ such packages with `node-addon-api` to provide more visibility to the community.
229
+
230
+ Quick links to NPM searches: [keywords:node-addon-api](https://www.npmjs.com/search?q=keywords%3Anode-addon-api).
231
+
232
+ <a name="other-bindings"></a>
233
+
234
+ ### **Other bindings**
235
+
236
+ - **[napi-rs](https://napi.rs)** - (`Rust`)
237
+
238
+ <a name="badges"></a>
239
+
240
+ ### **Badges**
241
+
242
+ The use of badges is recommended to indicate the minimum version of Node-API
243
+ required for the module. This helps to determine which Node.js major versions are
244
+ supported. Addon maintainers can consult the [Node-API support matrix][] to determine
245
+ which Node.js versions provide a given Node-API version. The following badges are
246
+ available:
247
+
248
+ ![Node-API v1 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v1%20Badge.svg)
249
+ ![Node-API v2 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v2%20Badge.svg)
250
+ ![Node-API v3 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v3%20Badge.svg)
251
+ ![Node-API v4 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v4%20Badge.svg)
252
+ ![Node-API v5 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v5%20Badge.svg)
253
+ ![Node-API v6 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v6%20Badge.svg)
254
+ ![Node-API v7 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v7%20Badge.svg)
255
+ ![Node-API v8 Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20v8%20Badge.svg)
256
+ ![Node-API Experimental Version Badge](https://github.com/nodejs/abi-stable-node/blob/doc/assets/Node-API%20Experimental%20Version%20Badge.svg)
257
+
258
+ ## **Contributing**
259
+
260
+ We love contributions from the community to **node-addon-api**!
261
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for more details on our philosophy around extending this module.
262
+
263
+ <a name="contributors"></a>
264
+
265
+ ## Team members
266
+
267
+ ### Active
268
+ | Name | GitHub Link |
269
+ | ------------------- | ----------------------------------------------------- |
270
+ | Anna Henningsen | [addaleax](https://github.com/addaleax) |
271
+ | Chengzhong Wu | [legendecas](https://github.com/legendecas) |
272
+ | Gabriel Schulhof | [gabrielschulhof](https://github.com/gabrielschulhof) |
273
+ | Jim Schlight | [jschlight](https://github.com/jschlight) |
274
+ | Michael Dawson | [mhdawson](https://github.com/mhdawson) |
275
+ | Kevin Eady | [KevinEady](https://github.com/KevinEady)
276
+ | Nicola Del Gobbo | [NickNaso](https://github.com/NickNaso) |
277
+
278
+ ### Emeritus
279
+ | Name | GitHub Link |
280
+ | ------------------- | ----------------------------------------------------- |
281
+ | Arunesh Chandra | [aruneshchandra](https://github.com/aruneshchandra) |
282
+ | Benjamin Byholm | [kkoopa](https://github.com/kkoopa) |
283
+ | Jason Ginchereau | [jasongin](https://github.com/jasongin) |
284
+ | Hitesh Kanwathirtha | [digitalinfinity](https://github.com/digitalinfinity) |
285
+ | Sampson Gao | [sampsongao](https://github.com/sampsongao) |
286
+ | Taylor Woll | [boingoing](https://github.com/boingoing) |
287
+
288
+ <a name="license"></a>
289
+
290
+ Licensed under [MIT](./LICENSE.md)
291
+
292
+ [ABI stability guide]: https://nodejs.org/en/docs/guides/abi-stability/
293
+ [Node-API support matrix]: https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix
@@ -0,0 +1,37 @@
1
+ environment:
2
+ # https://github.com/jasongin/nvs/blob/HEAD/doc/CI.md
3
+ NVS_VERSION: 1.4.2
4
+ matrix:
5
+ - NODEJS_VERSION: node/10
6
+ - NODEJS_VERSION: node/12
7
+ - NODEJS_VERSION: node/14
8
+ - NODEJS_VERSION: nightly
9
+
10
+ os: Visual Studio 2017
11
+ platform:
12
+ - x86
13
+ - x64
14
+
15
+ install:
16
+ # nvs
17
+ - git clone --branch v%NVS_VERSION% --depth 1 https://github.com/jasongin/nvs %LOCALAPPDATA%\nvs
18
+ - set PATH=%LOCALAPPDATA%\nvs;%PATH%
19
+ - nvs --version
20
+ # node.js
21
+ - nvs add %NODEJS_VERSION%/%PLATFORM%
22
+ - nvs use %NODEJS_VERSION%/%PLATFORM%
23
+ - node --version
24
+ - node -p process.arch
25
+ - npm --version
26
+ # app
27
+ - npm install
28
+
29
+ test_script:
30
+ - npm test
31
+
32
+ build: off
33
+
34
+ version: "{build}"
35
+
36
+ cache:
37
+ - node_modules
@@ -0,0 +1,47 @@
1
+ # Benchmarks
2
+
3
+ ## Running the benchmarks
4
+
5
+ From the parent directory, run
6
+
7
+ ```bash
8
+ npm run-script benchmark
9
+ ```
10
+
11
+ The above script supports the following arguments:
12
+
13
+ * `--benchmarks=...`: A semicolon-separated list of benchmark names. These names
14
+ will be mapped to file names in this directory by appending `.js`.
15
+
16
+ ## Adding benchmarks
17
+
18
+ The steps below should be followed when adding new benchmarks.
19
+
20
+ 0. Decide on a name for the benchmark. This name will be used in several places.
21
+ This example will use the name `new_benchmark`.
22
+
23
+ 0. Create files `new_benchmark.cc` and `new_benchmark.js` in this directory.
24
+
25
+ 0. Copy an existing benchmark in `binding.gyp` and change the target name prefix
26
+ and the source file name to `new_benchmark`. This should result in two new
27
+ targets which look like this:
28
+
29
+ ```gyp
30
+ {
31
+ 'target_name': 'new_benchmark',
32
+ 'sources': [ 'new_benchmark.cc' ],
33
+ 'includes': [ '../except.gypi' ],
34
+ },
35
+ {
36
+ 'target_name': 'new_benchmark_noexcept',
37
+ 'sources': [ 'new_benchmark.cc' ],
38
+ 'includes': [ '../noexcept.gypi' ],
39
+ },
40
+ ```
41
+
42
+ There should always be a pair of targets: one bearing the name of the
43
+ benchmark and configured with C++ exceptions enabled, and one bearing the
44
+ same name followed by the suffix `_noexcept` and configured with C++
45
+ exceptions disabled. This will ensure that the benchmark can be written to
46
+ cover both the case where C++ exceptions are enabled and the case where they
47
+ are disabled.
@@ -0,0 +1,25 @@
1
+ {
2
+ 'target_defaults': { 'includes': ['../common.gypi'] },
3
+ 'targets': [
4
+ {
5
+ 'target_name': 'function_args',
6
+ 'sources': [ 'function_args.cc' ],
7
+ 'includes': [ '../except.gypi' ],
8
+ },
9
+ {
10
+ 'target_name': 'function_args_noexcept',
11
+ 'sources': [ 'function_args.cc' ],
12
+ 'includes': [ '../noexcept.gypi' ],
13
+ },
14
+ {
15
+ 'target_name': 'property_descriptor',
16
+ 'sources': [ 'property_descriptor.cc' ],
17
+ 'includes': [ '../except.gypi' ],
18
+ },
19
+ {
20
+ 'target_name': 'property_descriptor_noexcept',
21
+ 'sources': [ 'property_descriptor.cc' ],
22
+ 'includes': [ '../noexcept.gypi' ],
23
+ },
24
+ ]
25
+ }