-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
trackingAn umbrella issue for tracking big featuresAn umbrella issue for tracking big features
Description
Node-API is Node.js' native addon API. The goal of this project is for many Node-API addons in bun.js to just work, without asking maintainers of node modules to make changes or rebuild their code specifically for Bun.
The first version will be scoped specifically to the napi_* functions. It will not include support for uv_* functions or the V8 C++ functions. A good initial target is napi.rs support.
- async_hooks resource tracking will not be supported, it will just ignore them.
- async cleanup will be stubbed
Internal changes
- Support resolving
.nodefiles -
process.dlopensupport for native modules -
requiresupport for native modules
API implementation
- napi_acquire_threadsafe_function
- napi_add_async_cleanup_hook
- napi_add_env_cleanup_hook
- napi_add_finalizer
- napi_adjust_external_memory (JSC doesn't have an exact version of this. it won't go down)
- napi_async_destroy
- napi_async_init
- napi_call_function
- napi_call_threadsafe_function
- napi_cancel_async_work
- napi_check_object_type_tag
- napi_close_callback_scope
- napi_close_escapable_handle_scope
- napi_close_handle_scope
- napi_coerce_to_bool
- napi_coerce_to_number
- napi_coerce_to_object
- napi_coerce_to_string
- napi_create_array
- napi_create_array_with_length
- napi_create_arraybuffer
- napi_create_async_work
- napi_create_bigint_int64
- napi_create_bigint_uint64
- napi_create_bigint_words
- napi_create_buffer
- napi_create_buffer_copy
- napi_create_dataview
- napi_create_date
- napi_create_double
- napi_create_error
- napi_create_external
- napi_create_external_arraybuffer
- napi_create_external_buffer
- napi_create_function
- napi_create_int32
- napi_create_int64
- napi_create_object
- napi_create_promise
- napi_create_range_error
- napi_create_reference
- napi_create_string_latin1
- napi_create_string_utf16
- napi_create_string_utf8
- napi_create_symbol
- napi_create_threadsafe_function
- napi_create_type_error
- napi_create_typedarray
- napi_create_uint32
- napi_define_class
- napi_define_properties
- napi_delete_async_work
- napi_delete_element
- napi_delete_property
- napi_delete_reference
- napi_detach_arraybuffer
- napi_escape_handle
- napi_fatal_error (works but message formatting is low quality)
- napi_fatal_exception (works but message formatting is low quality)
- napi_get_all_property_names
- napi_get_and_clear_last_exception (this uses
JSC::VM::lastException()) - napi_get_array_length
- napi_get_arraybuffer_info
- napi_get_boolean
- napi_get_buffer_info
- napi_get_cb_info
- napi_get_dataview_info
- napi_get_date_value
- napi_get_element
- napi_get_global
- napi_get_instance_data
- napi_get_last_error_info (stubbed, but with an error message)
- napi_get_named_property
- napi_get_new_target
- napi_get_node_version
- napi_get_null
- napi_get_property
- napi_get_property_names
- napi_get_prototype
- napi_get_reference_value
- napi_get_threadsafe_function_context
- napi_get_typedarray_info
- napi_get_undefined
- napi_get_uv_event_loop
- napi_get_value_bigint_int64
- napi_get_value_bigint_uint64
- napi_get_value_bigint_words
- napi_get_value_bool
- napi_get_value_double
- napi_get_value_external
- napi_get_value_int32
- napi_get_value_int64
- napi_get_value_string_latin1
- napi_get_value_string_utf16
- napi_get_value_string_utf8
- napi_get_value_uint32
- napi_get_version
- napi_has_element
- napi_has_named_property
- napi_has_own_property
- napi_has_property
- napi_instanceof
- napi_is_array
- napi_is_arraybuffer
- napi_is_buffer
- napi_is_dataview
- napi_is_date
- napi_is_detached_arraybuffer
- napi_is_error
- napi_is_exception_pending
- napi_is_promise
- napi_is_typedarray
- napi_make_callback
- napi_module_register
- napi_new_instance
- napi_object_freeze
- napi_object_seal
- napi_open_callback_scope
- napi_open_escapable_handle_scope
- napi_open_handle_scope
- napi_queue_async_work
- napi_ref_threadsafe_function
- napi_reference_ref
- napi_reference_unref
- napi_reject_deferred
- napi_release_threadsafe_function
- napi_remove_async_cleanup_hook
- napi_remove_env_cleanup_hook
- napi_remove_wrap
- napi_resolve_deferred
- napi_run_script
- napi_set_element
- napi_set_instance_data
- napi_set_named_property
- napi_set_property
- napi_strict_equals
- napi_throw
- napi_throw_error
- napi_throw_range_error
- napi_throw_type_error
- napi_type_tag_object
- napi_typeof
- napi_unref_threadsafe_function
- napi_unwrap
- napi_wrap
Test coverage
The tentative plan is to rely on napi.rs tests, but haven't checked yet if that's possible.
- napi_acquire_threadsafe_function
- napi_add_async_cleanup_hook
- napi_add_env_cleanup_hook
- napi_add_finalizer
- napi_adjust_external_memory
- napi_async_destroy
- napi_async_init
- napi_call_function
- napi_call_threadsafe_function
- napi_cancel_async_work
- napi_check_object_type_tag
- napi_close_callback_scope
- napi_close_escapable_handle_scope
- napi_close_handle_scope
- napi_coerce_to_bool
- napi_coerce_to_number
- napi_coerce_to_object
- napi_coerce_to_string
- napi_create_array
- napi_create_array_with_length
- napi_create_arraybuffer
- napi_create_async_work
- napi_create_bigint_int64
- napi_create_bigint_uint64
- napi_create_bigint_words
- napi_create_buffer
- napi_create_buffer_copy
- napi_create_dataview
- napi_create_date
- napi_create_double
- napi_create_error
- napi_create_external
- napi_create_external_arraybuffer
- napi_create_external_buffer
- napi_create_function
- napi_create_int32
- napi_create_int64
- napi_create_object
- napi_create_promise
- napi_create_range_error
- napi_create_reference
- napi_create_string_latin1
- napi_create_string_utf16
- napi_create_string_utf8
- napi_create_symbol
- napi_create_threadsafe_function
- napi_create_type_error
- napi_create_typedarray
- napi_create_uint32
- napi_define_class
- napi_define_properties
- napi_delete_async_work
- napi_delete_element
- napi_delete_property
- napi_delete_reference
- napi_detach_arraybuffer
- napi_escape_handle
- napi_fatal_error
- napi_fatal_exception
- napi_get_all_property_names
- napi_get_and_clear_last_exception
- napi_get_array_length
- napi_get_arraybuffer_info
- napi_get_boolean
- napi_get_buffer_info
- napi_get_cb_info
- napi_get_dataview_info
- napi_get_date_value
- napi_get_element
- napi_get_global
- napi_get_instance_data
- napi_get_last_error_info
- napi_get_named_property
- napi_get_new_target
- napi_get_node_version
- napi_get_null
- napi_get_property
- napi_get_property_names
- napi_get_prototype
- napi_get_reference_value
- napi_get_threadsafe_function_context
- napi_get_typedarray_info
- napi_get_undefined
- napi_get_uv_event_loop
- napi_get_value_bigint_int64
- napi_get_value_bigint_uint64
- napi_get_value_bigint_words
- napi_get_value_bool
- napi_get_value_double
- napi_get_value_external
- napi_get_value_int32
- napi_get_value_int64
- napi_get_value_string_latin1
- napi_get_value_string_utf16
- napi_get_value_string_utf8
- napi_get_value_uint32
- napi_get_version
- napi_has_element
- napi_has_named_property
- napi_has_own_property
- napi_has_property
- napi_instanceof
- napi_is_array
- napi_is_arraybuffer
- napi_is_buffer
- napi_is_dataview
- napi_is_date
- napi_is_detached_arraybuffer
- napi_is_error
- napi_is_exception_pending
- napi_is_promise
- napi_is_typedarray
- napi_make_callback
- napi_module_register
- napi_new_instance
- napi_object_freeze
- napi_object_seal
- napi_open_callback_scope
- napi_open_escapable_handle_scope
- napi_open_handle_scope
- napi_queue_async_work
- napi_ref_threadsafe_function
- napi_reference_ref
- napi_reference_unref
- napi_reject_deferred
- napi_release_threadsafe_function
- napi_remove_async_cleanup_hook
- napi_remove_env_cleanup_hook
- napi_remove_wrap
- napi_resolve_deferred
- napi_run_script
- napi_set_element
- napi_set_instance_data
- napi_set_named_property
- napi_set_property
- napi_strict_equals
- napi_throw
- napi_throw_error
- napi_throw_range_error
- napi_throw_type_error
- napi_type_tag_object
- napi_typeof
- napi_unref_threadsafe_function
- napi_unwrap
- napi_wrap
tscpp, JesusTheHun, zigang93, doomestee, maxstevens-nl and 31 morekachick, m1212e, iansinnott, etinaude, lok52 and 38 morebugs181, iansinnott, jakeboone02, corporatepiyush, ild0tt0re and 23 moreaewing, derhuerst, bugs181, ild0tt0re, clement-estone and 20 more
Metadata
Metadata
Assignees
Labels
trackingAn umbrella issue for tracking big featuresAn umbrella issue for tracking big features