node-gyp-hw
Version:
A simple Node.js native addon example
55 lines (38 loc) • 702 B
Markdown
# node-gyp-hw
一个简单的 Node.js 原生插件示例,返回 "Hello World"。
## 构建
```bash
npm i
```
## 安装
```bash
npm install node-gyp-hw
```
## 使用
```javascript
// 引入包
const hw = require('node-gyp-hw');
// 调用 hello 方法
console.log(hw.hello()); // 输出: Hello World
```
## 需求
此包需要在您的系统上安装适当的构建工具:
- GCC/G++
- Python>=3.12.x
### macOS
- Xcode 命令行工具 (`xcode-select --install`)
## 开发
如果您想从源代码构建此包:
```bash
git clone https://github.com/pigcanflyqaq/node-gyp-hw.git
cd node-gyp-hw
npm install node-addon-api
npm i
```
### 发布
```bash
npm publish
```
## 许可证
MIT
#