Native Abstractions for Node.js
===============================
**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.12 as well as io.js.**
***Current version: 1.8.4***
*(See [CHANGELOG.md](https://github.com/iojs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
[![NPM](https://nodei.co/npm/nan.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6&height=3)](https://nodei.co/npm/nan/)
[![Build Status](https://api.travis-ci.org/iojs/nan.svg?branch=master)](http://travis-ci.org/iojs/nan)
[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan)
Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.
This project also contains some helper utilities that make addon development a bit more pleasant.
* **[News & Updates](#news)**
* **[Usage](#usage)**
* **[Example](#example)**
* **[API](#api)**
* **[Tests](#tests)**
* **[Porting](#porting)**
* **[Governance & Contributing](#governance)**
<a name="news"></a>
## News & Updates
### Apr-2015: 1.8.0 release
* Support V8 4.2
* Removed support for creating `Signature`s with arguments
* Backported thread local storage routines for libuv
### Feb-2015: 1.7.0 release
* Made `NanCallback::Call` accept optional target
* Support atom-shell 0.21
Node 0.12.0 is out and supported by NAN. So is atom-shell 0.21. `NanCallback::Call` now accepts an optional `target` argument like `NanMakeCallback`.
### Jan-2015: 1.6.0 release
* Deprecated `NanNewContextHandle` in favor of `NanNew<Context>`
* Added `NanSetCounterFunction`, `NanSetCreateHistogramFunction`, `NanSetAddHistogramSampleFunction`
* Added `NanIdleNotification`, `NanLowMemoryNotification`, `NanContextDisposedNotification`
* Added `NanEncode`, `NanDecodeBytes` and `NanDecodeWrite`
### Jan-2015: 1.5.0 release
* Support [io.js](https://github.com/iojs/io.js) thanks to [Ben Noordhuis](bnoordhuis)
* Rewritten NanNew internals thanks to [David Siegel](agnat)
* NanAsyncWorker now supports progress reporting thanks to [Brett Lawson](brett19)
### Aug-2014: 1.3.0 release
* `NanCString()` and `NanRawString()` have been deprecated in favour of new <a href="#api_nan_ascii_string"><b><code>NanAsciiString</code></b></a>, <a href="#api_nan_utf8_string"><b><code>NanUtf8String</code></b></a> and <a href="#api_nan_ucs2_string"><b><code>NanUcs2String</code></b></a>. These classes manage the underlying memory for you in a safer way than just handing off an allocated array. You should now `*NanAsciiString(handle)` to access the raw `char` data, you can also allocate on the heap if you need to keep a reference.
* Two more <a href="#api_nan_make_callback"><b><code>NanMakeCallback</code></b></a> overloads have been added to for parity with Node core.
* You can now `NanNew(std::string)` (use `NanNew<std::string&>(std::string&)` to pass by reference)
* <a href="#api_nan_set_template"><b><code>NanSetTemplate</code></b></a>, <a href="#api_nan_set_prototype_template"><b><code>NanSetPrototypeTemplate</code></b></a> and <a href="#api_nan_set_instance_template"><b><code>NanSetInstanceTemplate</code></b></a> have been added.
### May-2014: 1.1.0 release
* We've deprecated `NanSymbol()`, you should just use `NanNew<String>()` now.
* `NanNull()`, `NanUndefined()`, `NanTrue()`, `NanFalse()` all return `Local`s now.
* `nan_isolate` is gone, it was intended to be internal-only but if you were using it then you should switch to `v8::Isolate::GetCurrent()`.
* `NanNew()` has received some additional overload-love so you should be able to give it many kinds of values without specifying the `<Type>`.
* Lots of small fixes and additions to expand the V8 API coverage, *use the source, Luke*.
### May-2014: Major changes for V8 3.25 / Node 0.11.13
Node 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes.
Because we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API.
We have **removed support for Node 0.11 versions prior to 0.11.13**. As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously.
The major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew<T>(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew<Type>(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local<T> NanNew(const Persistent<T> arg)` to replace `NanPersistentToLocal()`.
We also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this.
V8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local<T> value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local<T> value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality.
`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead.
Because `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallback()`. You should *always* use this when calling a JavaScript function from C++.
There's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/iojs/nan/pull/86) for all the gory details.
### Dec-2013: NanCString and NanRawString
Two new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments.
### Nov-2013: Node 0.11.9+ breaking V8 change
The version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local<T>::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal<T>(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases).
For example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local<v8::Value>::New(v8::Null())` to `NanNewLocal<v8::Value>(v8::Null())`.
### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN
Inclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答!该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用!有问题请及时沟通交流。 基于STM32、ESP8266、PHP、QT、应用软件开发、系统软件开发、移动应用开发、网站开发C++、Java、python、web、C#、单片机、EDA、proteus、RTOS、包括计算机硬件、服务器、网络设备、存储设备、移动设备、LInux、IOS、树莓派、安卓开发、微机操作系统、网络操作系统、分布式操作系统等。此外,还有嵌入式操作系统、智能操作系统等、数据集、大数据分析、人工智能、机器学习等各种项目 项目具有较高的学习借鉴价值,也适用于小白学习入门进阶。当然也可作为毕设项目、课程设计、大作业、初期项目立项演示等。如果基础还行,或者热爱钻研,亦可在此项目代码基础上进行修改添加,实现其他不同功能。欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
毕设&课设&项目&实训- 基于python的物联网数据收发平台.zip (1350个子文件)
ctio.3ctype 8KB
LICENSE.APACHE2 586B
AUTHORS 537B
AUTHORS 235B
LICENSE.BSD 1KB
disphelper.c 34KB
benchmark-native.c 613B
CHANGELOG 2KB
serialportterm.cmd 220B
serialportlist.cmd 212B
node-pre-gyp.cmd 206B
mkdirp.cmd 182B
semver.cmd 182B
nopt.cmd 180B
rimraf.cmd 174B
rc.cmd 170B
node-pre-gyp.cmd 40B
jsl.conf 6KB
CONTRIBUTORS 524B
enumser.cpp 47KB
serialport_unix.cpp 23KB
serialport.cpp 20KB
serialport_win.cpp 14KB
serialport_poller.cpp 3KB
mycss.css 591B
mycss.css 591B
mycss.css 591B
.dntrc 740B
.DS_Store 24KB
.DS_Store 21KB
.DS_Store 21KB
.DS_Store 12KB
.DS_Store 12KB
.DS_Store 12KB
.editorconfig 243B
.dir-locals.el 178B
.eslintrc 1KB
.eslintrc 367B
.gitignore 777B
bench.gnu 6KB
binding.gyp 1KB
semver.browser.js.gz 8KB
semver.min.js.gz 4KB
packed.tar.gz 152B
stdstring.h 133KB
nan.h 66KB
disphelper.h 21KB
nan_new.h 9KB
nan_implementation_12_inl.h 8KB
nan_string_bytes.h 8KB
nan_implementation_pre_12_inl.h 8KB
enumser.h 6KB
serialport.h 4KB
typecode.h 2KB
AutoHeapAlloc.h 2KB
AutoHModule.h 2KB
AutoHandle.h 1KB
stdafx.h 1KB
serialport_poller.h 749B
har-validator 1KB
test (复件).html 5KB
index.html 4KB
client.html 3KB
client (复件).html 3KB
client1.html 3KB
client.html 3KB
client.html 3KB
test.html 2KB
login.html 1KB
login.html 1KB
rfid_client.html 947B
light.html 630B
base.html 478B
base.html 429B
test.html 340B
hello.html 255B
index.html 229B
index.html 227B
.ignore 18B
foo.ini 1KB
config.ini 367B
arduinoEcho.ino 277B
ichart.1.2.js 202KB
ichart.1.2.js 202KB
ichart.1.2.js 202KB
bluebird.js 155KB
jquery-1.11.0.min.js 94KB
jquery-1.11.0.min.js 94KB
jquery-1.11.0.min.js 94KB
bluebird.min.js 71KB
index.js 60KB
browser.js 56KB
sockjs-0.3.min.js 48KB
sockjs-0.3.min.js 48KB
sockjs-0.3.min.js 48KB
ctio.js 43KB
request.js 42KB
server.js 39KB
semver.js 32KB
semver.browser.js 31KB
共 1350 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
妄北y
- 粉丝: 1w+
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- multisim1仿真运放及三极管电路应用经典电路multisim10仿真实例源文件合集(21个).zip
- 基于Android的Fragment+ViewPager实现滑屛切换界面应用设计与实现1(源码)
- tensorflow-2.9.3-cp38-cp38-win-amd64.whl
- tensorflow-gpu-2.9.3-cp38-cp38-win-amd64.whl
- 1716994562763661.750000.jpg
- tensorflow-gpu-2.9.2-cp38-cp38-win-amd64.whl
- FSA-火烈鸟搜索优化算法
- 幸运女生眷顾.html
- 送修改教程.zip
- java-选择排序.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功