Add example showing ts plus js plus cpp and c #161
Conversation
| extern "C" { | ||
| #endif | ||
|
|
||
| void cPart(); |
NickNaso
Oct 23, 2020
Member
What do you think to change the funtion cPart to be a non void function? In this way the example could be more complete and demostrate how to call from ts -> js -> c++ -> c passing some arguments and back.
What do you think to change the funtion cPart to be a non void function? In this way the example could be more complete and demostrate how to call from ts -> js -> c++ -> c passing some arguments and back.
helio-frota
Oct 23, 2020
•
Author
Contributor
This is a really good suggestion thank you.
What do you think a phrase like this ? :
I'm a C function and I received this $argument from C++
And then return an int back ?
And the the c++ says:
I'm a C++ function and I received this $argument from JS and this $return from C
and the same for JS and TS ...
something like that ? looks cool 😄
Since I still learning I'll probably delay a little bit but eager to implement that
This is a really good suggestion thank you.
What do you think a phrase like this ? :
I'm a C function and I received this $argument from C++
And then return an int back ?
And the the c++ says:
I'm a C++ function and I received this $argument from JS and this $return from C
and the same for JS and TS ...
something like that ? looks cool
Since I still learning I'll probably delay a little bit but eager to implement that
helio-frota
Oct 23, 2020
Author
Contributor
@NickNaso suggestions applied now it shows the following messages:
I'm a C function and I received 12 from C++ and I'm sending back 42
I'm a C++ function I'm sending 12 to C and I received 42
I'm a Javascript function and I'm sending 11 to C++ and I received 42
I'm a TypeScript class constructor I'm sending 10 to JavaScript and I received 42
@NickNaso suggestions applied now it shows the following messages:
I'm a C function and I received 12 from C++ and I'm sending back 42
I'm a C++ function I'm sending 12 to C and I received 42
I'm a Javascript function and I'm sending 11 to C++ and I received 42
I'm a TypeScript class constructor I'm sending 10 to JavaScript and I received 42
7c1dd44
to
a07ebfd
|
Could you please move the example in a folder called
|
a07ebfd
to
f764de9
|
@NickNaso example moved to the new directory, thank you for the review
|
| @@ -0,0 +1,2 @@ | |||
| node_modules | |||
gengjiawen
Oct 26, 2020
Member
This is unnecessary, as it's already declared in root folder.
This is unnecessary, as it's already declared in root folder.
f764de9
to
33abd10
33abd10
to
8d578fd
|
LGTM |
|
You can format your cpp code if your have used |
Yeah I still learning not only the language (c/cpp) but also the tools involved |
|
CI failed on macOS, looks like you need to add Log: https://github.com/nodejs/node-addon-examples/pull/161/checks?check_run_id=1308615674 |
8d578fd
to
0304e87
|
@gengjiawen PR updated |
|
LGTM |
|
I think calling this something like typescript_with_addon might make it more likely for people to find/understand what it is trying to show. |
0304e87
to
9b1c9db
|
@mhdawson thanks for the suggestion, example renamed |
4a1e9b5
into
nodejs:master
|
Thanks for the PR, great job. |
No description provided.