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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的课程设计、期末大作业和毕设项目,作为参考资料学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 医院设备管理系统源码+项目说明.zip
资源推荐
资源详情
资源评论
收起资源包目录
医院设备管理系统源码+项目说明.zip (1556个子文件)
kerberosgss.c 21KB
kerberosgss.c 21KB
kerberos_sspi.c 7KB
kerberos_sspi.c 7KB
base64.c 4KB
base64.c 4KB
base64.c 4KB
base64.c 4KB
Cakefile 624B
security_context.cc 31KB
security_context.cc 31KB
kerberos.cc 20KB
kerberos.cc 20KB
security_credentials.cc 12KB
security_credentials.cc 12KB
security_buffer_descriptor.cc 6KB
security_buffer_descriptor.cc 6KB
security_buffer.cc 3KB
security_buffer.cc 3KB
kerberos_context.cc 2KB
kerberos_context.cc 2KB
kerberos.cc 1KB
kerberos.cc 1KB
worker.cc 66B
worker.cc 66B
worker.cc 66B
worker.cc 66B
ipaddr.test.coffee 12KB
ipaddr.coffee 12KB
bootstrap.css 124KB
bootstrap-responsive.css 22KB
mocha.css 4KB
mocha.css 4KB
dashboard.css 2KB
style.css 110B
style.css 32B
items.css 0B
simple_2_document_limit_toArray.dat 75KB
simple_2_document_limit_toArray.dat 75KB
.dntrc 740B
.dntrc 740B
myitems.ejs 4KB
blank.ejs 4KB
userAdminPage.ejs 2KB
itemAdminPage.ejs 2KB
regPage.ejs 2KB
newItemPage.ejs 2KB
header.ejs 2KB
nav.ejs 951B
loginPage.ejs 823B
comments.ejs 387B
copyright.ejs 366B
footer.ejs 364B
rmWhitespace.ejs 353B
menu_preprocessor.ejs 251B
itemlist.ejs 244B
menu.ejs 222B
menu_var.ejs 183B
errorPage.ejs 133B
newlines.mixed.ejs 131B
no.semicolons.ejs 131B
literal.ejs 114B
include-abspath.ejs 114B
indexPage.ejs 107B
include.ejs 98B
newlines.ejs 90B
no.newlines.ejs 90B
include_preprocessor.ejs 80B
messed.ejs 72B
error.ejs 63B
include_preprocessor.css.ejs 62B
include.css.ejs 60B
no.newlines.error.ejs 47B
consecutive-tags.ejs 47B
include-simple.ejs 44B
include_preprocessor_cache.ejs 43B
double-quote.ejs 41B
item.ejs 39B
fail.ejs 35B
bom.ejs 35B
single-quote.ejs 34B
menu-item.ejs 33B
include_cache.ejs 33B
user-no-with.ejs 28B
pet.ejs 25B
user.ejs 21B
hello-world.ejs 20B
with-context.ejs 16B
para.ejs 11B
renderFile.ejs 10B
include_preprocessor.ejs 10B
include.ejs 10B
backslash.ejs 5B
.eslintignore 5B
.gitignore 243B
binding.gyp 1KB
binding.gyp 1KB
config.gypi 4KB
nan.h 66KB
nan.h 66KB
共 1556 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
土豆片片
- 粉丝: 1569
- 资源: 5636
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功