Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
cpp-npm-package-boilerplate
Advanced tools
A boilerplate for creating a C++ npm package
A boilerplate for creating a C++ npm package
Did you like the project? Please, considerate a donation to help improve!
A boilerplate for creating a C++ npm package✨
Install with yarn or npm:
yarn
ornpm
:
# yarn
yarn add cpp-npm-package-boilerplate
# npm
npm i cpp-npm-package-boilerplate --save
import { helloNative } from 'cpp-npm-package-boilerplate';
helloNative('World'); // Hello World
Note: This is example is a binding of the C++ function
helloNative
to the JavaScript functionhelloNative
.
#include <napi.h>
Napi::String hello(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();
Napi::String name = info[0].As<Napi::String>();
return Napi::String::New(env, "Hello " + name.Utf8Value());
}
Napi::Object Init(Napi::Env env, Napi::Object exports) {
exports.Set(Napi::String::New(env, "hello"), Napi::Function::New(env, hello));
return exports;
}
NODE_API_MODULE(hello, Init)
import bindings from 'bindings';
export const helloNative = bindings('hello.node').hello;
import bindings from 'bindings';
type THelloNative = (string: string) => string;
export const helloNative: THelloNative = bindings('hello.node').hello;
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Or buy me a coffee 🙌🏾
Copyright © 2022 Hebert F Barros.
This project is MIT licensed.
FAQs
A boilerplate for creating a C++ npm package
The npm package cpp-npm-package-boilerplate receives a total of 0 weekly downloads. As such, cpp-npm-package-boilerplate popularity was classified as not popular.
We found that cpp-npm-package-boilerplate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.