Update pkg to same Node addon Header #8

Merged
Sirherobrine23 merged 2 commits from rewrite_pkg into main 2025-04-27 06:59:22 +00:00

The entire module has been refactored to look more like a mix of Go and node-addon-api, with more Go-level typing, and some tweaks to cause fewer panics between calls.

New features

  • Call go functions directly from Javascript code.
  • abstraction Javascript primitives.
  • move cgo code to internal/ folder.
  • Convert go struct, slice and primitives to Javascript primitives, Object and Array.
  • Go safety call Javascript functions.

on nexts commits

  • Promise and Async Worker
  • Typed Array
  • Array Buffer
  • Dataview
  • Node Version
  • Class
  • Thread Safe Functions
The entire module has been refactored to look more like a mix of Go and `node-addon-api`, with more Go-level typing, and some tweaks to cause fewer panics between calls. ## New features - Call go functions directly from Javascript code. - abstraction Javascript primitives. - move cgo code to `internal/` folder. - Convert go struct, slice and primitives to Javascript primitives, Object and Array. - Go safety call Javascript functions. ## on nexts commits - Promise and Async Worker - Typed Array - Array Buffer - Dataview - Node Version - Class - Thread Safe Functions
Sirherobrine23 added 2 commits 2025-04-25 01:20:41 +00:00
- Added entry.go to define the N-API module and its initialization function.
- Created entry.h to declare the initializeModule function for N-API.
- Introduced napi_module.c to register the module with NAPI.
- Developed a test main.go to demonstrate the registration of a test function and property within the N-API module.

Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
Sirherobrine23 added 1 commit 2025-04-25 02:45:54 +00:00
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
Sirherobrine23 added 1 commit 2025-04-25 03:29:23 +00:00
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
Sirherobrine23 added 1 commit 2025-04-26 01:06:36 +00:00
Introduce the `js` package with utilities to automatically convert
Go values (structs, slices, functions, etc.) to NAPI values and
vice-versa using reflection.

This simplifies binding Go functions and data structures for use
in Node.js. Includes support for struct tags like `napi:"name,omitempty"`.
Sirherobrine23 added 1 commit 2025-04-26 04:13:50 +00:00
Sirherobrine23 force-pushed rewrite_pkg from a8b789af77 to 9ed23341ac 2025-04-26 04:40:14 +00:00 Compare
Sirherobrine23 force-pushed rewrite_pkg from 9ed23341ac to d439561545 2025-04-26 04:42:45 +00:00 Compare
Sirherobrine23 added 1 commit 2025-04-27 01:45:15 +00:00
Refine Buffer API functions for better N-API alignment.
Improve error handling in module initialization.
Sirherobrine23 changed title from WIP: Update pkg to same Node addon Header to Update pkg to same Node addon Header 2025-04-27 06:44:59 +00:00
Sirherobrine23 merged commit 32f3ff500d into main 2025-04-27 06:59:22 +00:00
Sirherobrine23 deleted branch rewrite_pkg 2025-04-27 06:59:28 +00:00
Sign in to join this conversation.
No description provided.