Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About BigInt usage #706

Closed
Catutigernos opened this issue Apr 20, 2020 · 4 comments
Closed

About BigInt usage #706

Catutigernos opened this issue Apr 20, 2020 · 4 comments

Comments

@Catutigernos
Copy link

Hi,
I am developing a module has some function get 64 bit integer as parameter, javascript side I sent as bigint, but native side I can not get the parameter with NAPI. I check lib, and BigInt is guarded in native library, and I check parameter type in native side, variable type is 9, and I cannot find the type in napi_valuetype enum. How could I get the 64 bit number? If I can't when BigInt will be published?

Thanks in advance.

@NickNaso
Copy link
Member

Hi @Catutigernos,
if you want to use BigInt you need to define NAPI_EXPERIMENTAL macro in your code because until N-API version 5 BigInt is an experimental feature.
We are working on a new version here #689 where we support N-API version 6 that includes BigInt as stable API.

@Catutigernos
Copy link
Author

Hi @NickNaso,
Thanks for your response. I will try, but I am not sure about its reliability, because it can be unstable. Is there any estimated release date for N-API 6?

@mhdawson
Copy link
Member

It's in 10.x and 14.x (see https://github.com/nodejs/node/blob/master/doc/api/n-api.md for the version where it was added) I think just waiting on the next SemVer minor of 12.x for it to be there.

@gabrielschulhof
Copy link
Contributor

@Catutigernos N-API 6 should now be available across all LTS versions. Please re-open this issue and/or file a new one if you still have questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants