GithubHelp home page GithubHelp logo

nodetest's Introduction

生成build

node-gyp configure

生成release

node-gyp build

根据指定版本重编

node-gyp rebuild --target=4.2.12 --arch= --dist-url=https://npm.taobao.org/mirrors/atom-shell

--arch=ia32 是32位

--arch=x64 是64位

--target指定electron版本号

--dist-url指定头文件下载地址,原答案这个值写的是https://atom.io/download/electron,国内的话不管用

测试js里使用addon.node

node test.js

可参考的demo项目

https://github.com/freezer333/nodecpp-demo.git

https://github.com/caoxiemeihao/node-addons-learn.git

V8

v8 api

node-gyp 子命令

  • $ node-gyp configure:通过当前目录的 binding.gyp 生成项目文件,如 Makefile 等;
  • $ node-gyp build:将当前项目进行构建编译,前置操作必须先 configure;
  • $ node-gyp clean:清理生成的构建文件以及输出目录,说白了就是把目录清理了;
  • $ node-gyp rebuild:相当于依次执行了 clean、configure 和 build;
  • $ node-gyp install:手动下载当前版本的 Node.js 的头文件和库文件到对应目录。

hello、test

使用nan

引入头文件 #include <nan.h>

calldll

由c库编写的库

使用napi

引入头文件 #include <node_api.h>

cppCallDll

由c++库编写的库

使用node-addon-api

引入头文件 #include <napi.h>

nodetest's People

Contributors

ljlcarrien avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.