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

Added HelloWorld example as requested #107

Open
wants to merge 6 commits into
base: master
from
Open

Conversation

@Misery42
Copy link

@Misery42 Misery42 commented Aug 17, 2019

See #83 (comment)

Reading the readme files in the repository and the first HelloWorld example didn't clarify how I should structure this example properly, so I hope you could help me do it right, in case I made a mistake.

Misery42 and others added 6 commits Aug 17, 2019
* fixes #83
* NAPI example for working with UTF-8 encoded strings
Added execution of ./lib/buid.sh
inital upload
@mhdawson
Copy link
Member

@mhdawson mhdawson commented Aug 20, 2019

I'll have to look a bit more closely but one thing about the rename is that we have use common names across the n-api node-addon-api and the other examples. For that reason we would either need to keep the original naming and the new example in a new directory or rename the corresponding example for the other approaches as well (node-addon-api, nan, etc)

@theAkito
Copy link

@theAkito theAkito commented Aug 20, 2019

@mhdawson Could you elaborate on your proposition with a precise example regarding this specific pull request? So there won't be any additional mistakes.

@mhdawson
Copy link
Member

@mhdawson mhdawson commented Aug 22, 2019

I'd suggest adding a new example called "string_handling" with the focus on showing how to use the string functions. The starting point could be the hello world example, but getting/creating more strings, with each set of commands that gets/creates a string illustrating one of the points which is not clear. For example, the different ways that you can create a string which is null terminate (using auto length, getting the length and then specifying it etc.

The output itself might just be Hello world string1, string2, string3 etc.

but the code whichs gets/creates string1, string2, etc. would be comment to illustrate and explain the gotcha/issues you ran into?

Ideally, the same example could also be implemented in plain N-API (in addition to to node-addon-api)

Does that make sense?

@mhdawson
Copy link
Member

@mhdawson mhdawson commented Sep 22, 2020

@theAkito are you still planning to work on this?

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.