koffi 0.9.0 → 0.9.3
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/CMakeLists.txt +2 -36
- package/package.json +8 -4
- package/vendor/dragonbox/CMakeLists.txt +123 -0
- package/vendor/dragonbox/LICENSE-Apache2-LLVM +218 -0
- package/vendor/dragonbox/LICENSE-Boost +23 -0
- package/vendor/dragonbox/README.md +277 -0
- package/vendor/dragonbox/cmake/dragonboxConfig.cmake +1 -0
- package/vendor/dragonbox/include/dragonbox/dragonbox.h +2670 -0
- package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +108 -0
- package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
- package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
- package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +540 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
- package/vendor/dragonbox/source/dragonbox_to_chars.cpp +303 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +24 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +238 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +95 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +2666 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +16 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +114 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +509 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +367 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +357 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +35 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +345 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +55 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +128 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +46 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +22 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +699 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +31 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +1354 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +31 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +68 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +25 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +92 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +121 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +99 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +93 -0
- package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +65 -0
- package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +40 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +22 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +78 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +95 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +238 -0
- package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +30 -0
- package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +36 -0
- package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +27 -0
- package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +31 -0
- package/vendor/dragonbox/subproject/common/CMakeLists.txt +42 -0
- package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +97 -0
- package/vendor/dragonbox/subproject/common/include/big_uint.h +218 -0
- package/vendor/dragonbox/subproject/common/include/continued_fractions.h +174 -0
- package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +267 -0
- package/vendor/dragonbox/subproject/common/include/random_float.h +182 -0
- package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +57 -0
- package/vendor/dragonbox/subproject/common/source/big_uint.cpp +602 -0
- package/vendor/dragonbox/subproject/meta/CMakeLists.txt +41 -0
- package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +82 -0
- package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +10 -0
- package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +623 -0
- package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +126 -0
- package/vendor/dragonbox/subproject/meta/source/live_test.cpp +81 -0
- package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +104 -0
- package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +20 -0
- package/vendor/dragonbox/subproject/test/CMakeLists.txt +70 -0
- package/vendor/dragonbox/subproject/test/results/binary32.csv +255 -0
- package/vendor/dragonbox/subproject/test/results/binary64.csv +2047 -0
- package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +18 -0
- package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +88 -0
- package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +95 -0
- package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +338 -0
- package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +154 -0
- package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +168 -0
- package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +251 -0
- package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +113 -0
- package/vendor/libcc/libcc.cc +7651 -0
- package/vendor/libcc/libcc.hh +4312 -0
- package/vendor/node-addon-api/CHANGELOG.md +859 -0
- package/vendor/node-addon-api/CODE_OF_CONDUCT.md +4 -0
- package/vendor/node-addon-api/CONTRIBUTING.md +93 -0
- package/vendor/node-addon-api/LICENSE.md +13 -0
- package/vendor/node-addon-api/README.md +293 -0
- package/vendor/node-addon-api/appveyor.yml +37 -0
- package/vendor/node-addon-api/benchmark/README.md +47 -0
- package/vendor/node-addon-api/benchmark/binding.gyp +25 -0
- package/vendor/node-addon-api/benchmark/function_args.cc +217 -0
- package/vendor/node-addon-api/benchmark/function_args.js +60 -0
- package/vendor/node-addon-api/benchmark/index.js +34 -0
- package/vendor/node-addon-api/benchmark/property_descriptor.cc +91 -0
- package/vendor/node-addon-api/benchmark/property_descriptor.js +37 -0
- package/vendor/node-addon-api/common.gypi +21 -0
- package/vendor/node-addon-api/doc/addon.md +163 -0
- package/vendor/node-addon-api/doc/array.md +81 -0
- package/vendor/node-addon-api/doc/array_buffer.md +155 -0
- package/vendor/node-addon-api/doc/async_context.md +86 -0
- package/vendor/node-addon-api/doc/async_operations.md +31 -0
- package/vendor/node-addon-api/doc/async_worker.md +427 -0
- package/vendor/node-addon-api/doc/async_worker_variants.md +557 -0
- package/vendor/node-addon-api/doc/bigint.md +97 -0
- package/vendor/node-addon-api/doc/boolean.md +68 -0
- package/vendor/node-addon-api/doc/buffer.md +150 -0
- package/vendor/node-addon-api/doc/callback_scope.md +54 -0
- package/vendor/node-addon-api/doc/callbackinfo.md +97 -0
- package/vendor/node-addon-api/doc/checker-tool.md +32 -0
- package/vendor/node-addon-api/doc/class_property_descriptor.md +115 -0
- package/vendor/node-addon-api/doc/cmake-js.md +68 -0
- package/vendor/node-addon-api/doc/conversion-tool.md +28 -0
- package/vendor/node-addon-api/doc/creating_a_release.md +62 -0
- package/vendor/node-addon-api/doc/dataview.md +248 -0
- package/vendor/node-addon-api/doc/date.md +68 -0
- package/vendor/node-addon-api/doc/env.md +196 -0
- package/vendor/node-addon-api/doc/error.md +120 -0
- package/vendor/node-addon-api/doc/error_handling.md +254 -0
- package/vendor/node-addon-api/doc/escapable_handle_scope.md +80 -0
- package/vendor/node-addon-api/doc/external.md +63 -0
- package/vendor/node-addon-api/doc/function.md +402 -0
- package/vendor/node-addon-api/doc/function_reference.md +238 -0
- package/vendor/node-addon-api/doc/generator.md +13 -0
- package/vendor/node-addon-api/doc/handle_scope.md +63 -0
- package/vendor/node-addon-api/doc/hierarchy.md +91 -0
- package/vendor/node-addon-api/doc/instance_wrap.md +408 -0
- package/vendor/node-addon-api/doc/maybe.md +76 -0
- package/vendor/node-addon-api/doc/memory_management.md +27 -0
- package/vendor/node-addon-api/doc/name.md +29 -0
- package/vendor/node-addon-api/doc/node-gyp.md +82 -0
- package/vendor/node-addon-api/doc/number.md +163 -0
- package/vendor/node-addon-api/doc/object.md +432 -0
- package/vendor/node-addon-api/doc/object_lifetime_management.md +83 -0
- package/vendor/node-addon-api/doc/object_reference.md +117 -0
- package/vendor/node-addon-api/doc/object_wrap.md +561 -0
- package/vendor/node-addon-api/doc/prebuild_tools.md +16 -0
- package/vendor/node-addon-api/doc/promises.md +79 -0
- package/vendor/node-addon-api/doc/property_descriptor.md +286 -0
- package/vendor/node-addon-api/doc/propertylvalue.md +50 -0
- package/vendor/node-addon-api/doc/range_error.md +59 -0
- package/vendor/node-addon-api/doc/reference.md +113 -0
- package/vendor/node-addon-api/doc/setup.md +110 -0
- package/vendor/node-addon-api/doc/string.md +93 -0
- package/vendor/node-addon-api/doc/symbol.md +61 -0
- package/vendor/node-addon-api/doc/threadsafe.md +121 -0
- package/vendor/node-addon-api/doc/threadsafe_function.md +290 -0
- package/vendor/node-addon-api/doc/type_error.md +59 -0
- package/vendor/node-addon-api/doc/typed_array.md +78 -0
- package/vendor/node-addon-api/doc/typed_array_of.md +137 -0
- package/vendor/node-addon-api/doc/typed_threadsafe_function.md +306 -0
- package/vendor/node-addon-api/doc/value.md +340 -0
- package/vendor/node-addon-api/doc/version_management.md +43 -0
- package/vendor/node-addon-api/except.gypi +25 -0
- package/vendor/node-addon-api/index.js +11 -0
- package/vendor/node-addon-api/napi-inl.deprecated.h +192 -0
- package/vendor/node-addon-api/napi-inl.h +6209 -0
- package/vendor/node-addon-api/napi.h +2983 -0
- package/vendor/node-addon-api/node_api.gyp +9 -0
- package/vendor/node-addon-api/noexcept.gypi +26 -0
- package/vendor/node-addon-api/nothing.c +0 -0
- package/vendor/node-addon-api/package-support.json +21 -0
- package/vendor/node-addon-api/package.json +399 -0
- package/vendor/node-addon-api/test/README.md +91 -0
- package/vendor/node-addon-api/test/addon.cc +36 -0
- package/vendor/node-addon-api/test/addon.js +11 -0
- package/vendor/node-addon-api/test/addon_build/index.js +49 -0
- package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +17 -0
- package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +62 -0
- package/vendor/node-addon-api/test/addon_build/tpl/index.js +9 -0
- package/vendor/node-addon-api/test/addon_build/tpl/package.json +11 -0
- package/vendor/node-addon-api/test/addon_data.cc +99 -0
- package/vendor/node-addon-api/test/addon_data.js +46 -0
- package/vendor/node-addon-api/test/array_buffer.cc +243 -0
- package/vendor/node-addon-api/test/array_buffer.js +69 -0
- package/vendor/node-addon-api/test/async_context.cc +21 -0
- package/vendor/node-addon-api/test/async_context.js +86 -0
- package/vendor/node-addon-api/test/async_progress_queue_worker.cc +83 -0
- package/vendor/node-addon-api/test/async_progress_queue_worker.js +46 -0
- package/vendor/node-addon-api/test/async_progress_worker.cc +134 -0
- package/vendor/node-addon-api/test/async_progress_worker.js +61 -0
- package/vendor/node-addon-api/test/async_worker.cc +106 -0
- package/vendor/node-addon-api/test/async_worker.js +179 -0
- package/vendor/node-addon-api/test/async_worker_nocallback.js +13 -0
- package/vendor/node-addon-api/test/async_worker_persistent.cc +63 -0
- package/vendor/node-addon-api/test/async_worker_persistent.js +24 -0
- package/vendor/node-addon-api/test/basic_types/array.cc +40 -0
- package/vendor/node-addon-api/test/basic_types/array.js +35 -0
- package/vendor/node-addon-api/test/basic_types/boolean.cc +38 -0
- package/vendor/node-addon-api/test/basic_types/boolean.js +35 -0
- package/vendor/node-addon-api/test/basic_types/number.cc +99 -0
- package/vendor/node-addon-api/test/basic_types/number.js +114 -0
- package/vendor/node-addon-api/test/basic_types/value.cc +120 -0
- package/vendor/node-addon-api/test/basic_types/value.js +133 -0
- package/vendor/node-addon-api/test/bigint.cc +91 -0
- package/vendor/node-addon-api/test/bigint.js +53 -0
- package/vendor/node-addon-api/test/binding-swallowexcept.cc +12 -0
- package/vendor/node-addon-api/test/binding.cc +171 -0
- package/vendor/node-addon-api/test/binding.gyp +117 -0
- package/vendor/node-addon-api/test/buffer.cc +183 -0
- package/vendor/node-addon-api/test/buffer.js +69 -0
- package/vendor/node-addon-api/test/callbackscope.cc +22 -0
- package/vendor/node-addon-api/test/callbackscope.js +49 -0
- package/vendor/node-addon-api/test/common/index.js +113 -0
- package/vendor/node-addon-api/test/common/test_helper.h +61 -0
- package/vendor/node-addon-api/test/dataview/dataview.cc +48 -0
- package/vendor/node-addon-api/test/dataview/dataview.js +35 -0
- package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +115 -0
- package/vendor/node-addon-api/test/dataview/dataview_read_write.js +90 -0
- package/vendor/node-addon-api/test/date.cc +44 -0
- package/vendor/node-addon-api/test/date.js +18 -0
- package/vendor/node-addon-api/test/env_cleanup.cc +88 -0
- package/vendor/node-addon-api/test/env_cleanup.js +56 -0
- package/vendor/node-addon-api/test/error.cc +287 -0
- package/vendor/node-addon-api/test/error.js +81 -0
- package/vendor/node-addon-api/test/error_handling_for_primitives.cc +13 -0
- package/vendor/node-addon-api/test/error_handling_for_primitives.js +29 -0
- package/vendor/node-addon-api/test/error_terminating_environment.js +94 -0
- package/vendor/node-addon-api/test/external.cc +81 -0
- package/vendor/node-addon-api/test/external.js +88 -0
- package/vendor/node-addon-api/test/function.cc +295 -0
- package/vendor/node-addon-api/test/function.js +121 -0
- package/vendor/node-addon-api/test/function_reference.cc +202 -0
- package/vendor/node-addon-api/test/function_reference.js +157 -0
- package/vendor/node-addon-api/test/globalObject/global_object.cc +61 -0
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +31 -0
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +61 -0
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +40 -0
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +57 -0
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +28 -0
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +48 -0
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +31 -0
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +58 -0
- package/vendor/node-addon-api/test/handlescope.cc +60 -0
- package/vendor/node-addon-api/test/handlescope.js +14 -0
- package/vendor/node-addon-api/test/index.js +136 -0
- package/vendor/node-addon-api/test/maybe/check.cc +23 -0
- package/vendor/node-addon-api/test/maybe/index.js +38 -0
- package/vendor/node-addon-api/test/memory_management.cc +17 -0
- package/vendor/node-addon-api/test/memory_management.js +9 -0
- package/vendor/node-addon-api/test/movable_callbacks.cc +23 -0
- package/vendor/node-addon-api/test/movable_callbacks.js +21 -0
- package/vendor/node-addon-api/test/name.cc +108 -0
- package/vendor/node-addon-api/test/name.js +59 -0
- package/vendor/node-addon-api/test/napi_child.js +14 -0
- package/vendor/node-addon-api/test/object/delete_property.cc +38 -0
- package/vendor/node-addon-api/test/object/delete_property.js +41 -0
- package/vendor/node-addon-api/test/object/finalizer.cc +29 -0
- package/vendor/node-addon-api/test/object/finalizer.js +28 -0
- package/vendor/node-addon-api/test/object/get_property.cc +34 -0
- package/vendor/node-addon-api/test/object/get_property.js +40 -0
- package/vendor/node-addon-api/test/object/has_own_property.cc +34 -0
- package/vendor/node-addon-api/test/object/has_own_property.js +34 -0
- package/vendor/node-addon-api/test/object/has_property.cc +38 -0
- package/vendor/node-addon-api/test/object/has_property.js +37 -0
- package/vendor/node-addon-api/test/object/object.cc +348 -0
- package/vendor/node-addon-api/test/object/object.js +217 -0
- package/vendor/node-addon-api/test/object/object_deprecated.cc +66 -0
- package/vendor/node-addon-api/test/object/object_deprecated.js +47 -0
- package/vendor/node-addon-api/test/object/object_freeze_seal.cc +25 -0
- package/vendor/node-addon-api/test/object/object_freeze_seal.js +61 -0
- package/vendor/node-addon-api/test/object/set_property.cc +37 -0
- package/vendor/node-addon-api/test/object/set_property.js +29 -0
- package/vendor/node-addon-api/test/object/subscript_operator.cc +42 -0
- package/vendor/node-addon-api/test/object/subscript_operator.js +17 -0
- package/vendor/node-addon-api/test/object_reference.cc +219 -0
- package/vendor/node-addon-api/test/object_reference.js +259 -0
- package/vendor/node-addon-api/test/objectwrap.cc +268 -0
- package/vendor/node-addon-api/test/objectwrap.js +284 -0
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +26 -0
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +18 -0
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +30 -0
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +13 -0
- package/vendor/node-addon-api/test/objectwrap_removewrap.cc +45 -0
- package/vendor/node-addon-api/test/objectwrap_removewrap.js +40 -0
- package/vendor/node-addon-api/test/objectwrap_worker_thread.js +19 -0
- package/vendor/node-addon-api/test/promise.cc +29 -0
- package/vendor/node-addon-api/test/promise.js +18 -0
- package/vendor/node-addon-api/test/reference.cc +24 -0
- package/vendor/node-addon-api/test/reference.js +14 -0
- package/vendor/node-addon-api/test/run_script.cc +56 -0
- package/vendor/node-addon-api/test/run_script.js +45 -0
- package/vendor/node-addon-api/test/symbol.cc +79 -0
- package/vendor/node-addon-api/test/symbol.js +73 -0
- package/vendor/node-addon-api/test/testUtil.js +54 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +195 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +188 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +63 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +12 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +115 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +14 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +26 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +7 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +225 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +59 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +42 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +53 -0
- package/vendor/node-addon-api/test/thunking_manual.cc +140 -0
- package/vendor/node-addon-api/test/thunking_manual.js +17 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +215 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +188 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +68 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +12 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +127 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +14 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +28 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +7 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +237 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +59 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +53 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +53 -0
- package/vendor/node-addon-api/test/typedarray-bigint.js +58 -0
- package/vendor/node-addon-api/test/typedarray.cc +216 -0
- package/vendor/node-addon-api/test/typedarray.js +69 -0
- package/vendor/node-addon-api/test/version_management.cc +27 -0
- package/vendor/node-addon-api/test/version_management.js +31 -0
- package/vendor/node-addon-api/tools/README.md +73 -0
- package/vendor/node-addon-api/tools/check-napi.js +100 -0
- package/vendor/node-addon-api/tools/clang-format.js +68 -0
- package/vendor/node-addon-api/tools/conversion.js +309 -0
- package/vendor/node-addon-api/tools/eslint-format.js +71 -0
- package/build/ALL_BUILD.vcxproj +0 -190
- package/build/ALL_BUILD.vcxproj.filters +0 -8
- package/build/CMakeCache.txt +0 -429
- package/build/CMakeFiles/3.23.0-rc1/CMakeASMCompiler.cmake +0 -20
- package/build/CMakeFiles/3.23.0-rc1/CMakeASM_MASMCompiler.cmake +0 -20
- package/build/CMakeFiles/3.23.0-rc1/CMakeCCompiler.cmake +0 -72
- package/build/CMakeFiles/3.23.0-rc1/CMakeCXXCompiler.cmake +0 -83
- package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_C.bin +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CMakeRCCompiler.cmake +0 -6
- package/build/CMakeFiles/3.23.0-rc1/CMakeSystem.cmake +0 -15
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CMakeCCompilerId.c +0 -828
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.exe +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.vcxproj +0 -71
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CMakeCCompilerId.obj +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.exe.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CompilerIdC.lastbuildstate +0 -2
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -816
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.exe +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.vcxproj +0 -71
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.exe.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate +0 -2
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.txt +0 -1
- package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.vcxproj +0 -31
- package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.tlog/VCTargetsPath.lastbuildstate +0 -2
- package/build/CMakeFiles/41bcd16856091d4a38fd1f71fbe2f202/generate.stamp.rule +0 -1
- package/build/CMakeFiles/CMakeError.log +0 -108
- package/build/CMakeFiles/CMakeOutput.log +0 -413
- package/build/CMakeFiles/TargetDirectories.txt +0 -4
- package/build/CMakeFiles/cmake.check_cache +0 -1
- package/build/CMakeFiles/generate.stamp +0 -1
- package/build/CMakeFiles/generate.stamp.depend +0 -28
- package/build/CMakeFiles/generate.stamp.list +0 -1
- package/build/Raylib.dir/Release/Raylib.dll.recipe +0 -14
- package/build/Raylib.dir/Release/Raylib.tlog/CL.command.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CL.read.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CL.write.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/Raylib.dir/Release/Raylib.tlog/Raylib.lastbuildstate +0 -2
- package/build/Raylib.dir/Release/Raylib.tlog/Raylib.write.1u.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.command.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.read.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.write.1.tlog +0 -0
- package/build/Raylib.dir/Release/raudio.obj +0 -0
- package/build/Raylib.dir/Release/rcore.obj +0 -0
- package/build/Raylib.dir/Release/rglfw.obj +0 -0
- package/build/Raylib.dir/Release/rmodels.obj +0 -0
- package/build/Raylib.dir/Release/rshapes.obj +0 -0
- package/build/Raylib.dir/Release/rtext.obj +0 -0
- package/build/Raylib.dir/Release/rtextures.obj +0 -0
- package/build/Raylib.dir/Release/utils.obj +0 -0
- package/build/Raylib.vcxproj +0 -358
- package/build/Raylib.vcxproj.filters +0 -37
- package/build/Release/Raylib.dll +0 -0
- package/build/Release/Raylib.exp +0 -0
- package/build/Release/Raylib.lib +0 -0
- package/build/Release/koffi.exp +0 -0
- package/build/Release/koffi.lib +0 -0
- package/build/Release/koffi.node +0 -0
- package/build/ZERO_CHECK.vcxproj +0 -176
- package/build/ZERO_CHECK.vcxproj.filters +0 -13
- package/build/cmake_install.cmake +0 -44
- package/build/koffi.dir/Release/call_arm64.obj +0 -0
- package/build/koffi.dir/Release/call_x64_sysv.obj +0 -0
- package/build/koffi.dir/Release/call_x64_win.obj +0 -0
- package/build/koffi.dir/Release/call_x64_win_fwd.obj +0 -0
- package/build/koffi.dir/Release/call_x86.obj +0 -0
- package/build/koffi.dir/Release/ffi.obj +0 -0
- package/build/koffi.dir/Release/koffi.node.recipe +0 -14
- package/build/koffi.dir/Release/koffi.tlog/CL.command.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CL.read.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CL.write.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/koffi.dir/Release/koffi.tlog/Masm.read.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/Masm.write.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/koffi.lastbuildstate +0 -2
- package/build/koffi.dir/Release/koffi.tlog/koffi.write.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.command.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.read.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.write.1.tlog +0 -0
- package/build/koffi.dir/Release/libcc.obj +0 -0
- package/build/koffi.dir/Release/util.obj +0 -0
- package/build/koffi.dir/Release/win_delay_load_hook.obj +0 -0
- package/build/koffi.sln +0 -67
- package/build/koffi.vcxproj +0 -363
- package/build/koffi.vcxproj.filters +0 -40
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.recipe +0 -20
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/ALL_BUILD.lastbuildstate +0 -2
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.recipe +0 -11
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.read.1.tlog +0 -28
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate +0 -2
|
@@ -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
|
+
[](https://nodei.co/npm/node-addon-api/) [](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
|
+

|
|
249
|
+

|
|
250
|
+

|
|
251
|
+

|
|
252
|
+

|
|
253
|
+

|
|
254
|
+

|
|
255
|
+

|
|
256
|
+

|
|
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
|
+
}
|