{"id":16384930,"url":"https://github.com/saber2pr/node-cpp-helloworld","last_synced_at":"2026-04-15T12:34:29.824Z","repository":{"id":108571359,"uuid":"185023443","full_name":"Saber2pr/node-cpp-helloworld","owner":"Saber2pr","description":"\u003e 一起来为 V8 编写 C++插件吧！","archived":false,"fork":false,"pushed_at":"2019-05-05T14:54:09.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T14:44:31.196Z","etag":null,"topics":["addon","cpp","nodejs","v8"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saber2pr.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-05T11:40:06.000Z","updated_at":"2019-05-05T14:54:10.000Z","dependencies_parsed_at":"2023-03-13T14:24:52.983Z","dependency_job_id":null,"html_url":"https://github.com/Saber2pr/node-cpp-helloworld","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode-cpp-helloworld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode-cpp-helloworld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode-cpp-helloworld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fnode-cpp-helloworld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saber2pr","download_url":"https://codeload.github.com/Saber2pr/node-cpp-helloworld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122033,"owners_count":19751133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","cpp","nodejs","v8"],"created_at":"2024-10-11T04:13:00.557Z","updated_at":"2026-04-15T12:34:24.797Z","avatar_url":"https://github.com/Saber2pr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nodejs C++扩展 Helloworld\n\n\u003e 一起来为 V8 编写 C++插件吧！\n\n[官方文档](http://nodejs.cn/api/addons.html)\n\n```bash\ngit clone https://github.com/Saber2pr/node-cpp-helloworld.git\n```\n\n# 编译步骤\n\n1. 安装 node-gyp 编译工具\n\n```bash\n# 安装node-gyp编译工具\nsudo npm install\n```\n\n2. 生成 Makefile（在 Windows 上是 vcxproj 文件）\n\n```bash\n# 生成Makefile（在 Windows 上是vcxproj 文件）\nnpm run config\n```\n\n3. 编写 cpp 源文件，添加到./binding.gyp \u003e targets \u003e sources 项中，然后编译\n\n```bash\nnpm run build\n```\n\n4. 在./build/Release 目录下生成二进制文件 addon.node，javascript 文件中直接 require 即可，后缀.node 可省略\n\n```bash\nnpm test\n```\n\n# 可以干什么\n\n可以做 javascript 不能完成的任务。。。\n\n例如\n\n1. 文件读写\n\n2. 多线程处理\n\n3. Socket\n\n4. 调用系统 API\n\n5. 高性能场景\n\n...\n\n当然有局限性，这些二进制代码不能被前端构建工具打包，只适用于服务端环境\n\n# Notice\n\nwindows 下需要 vc++工具链\n\nlinux 下需要 g++\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fnode-cpp-helloworld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaber2pr%2Fnode-cpp-helloworld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fnode-cpp-helloworld/lists"}