diff --git a/.gitignore b/.gitignore index 4d1314326..88ac25d4b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,6 @@ test-storage* !/node_modules/tar.gz !/node_modules/sinopia-htpasswd !/node_modules/crypt3 +/node_modules/crypt3/build !/node_modules/http-errors diff --git a/node_modules/crypt3/.gitignore b/node_modules/crypt3/.npmignore similarity index 100% rename from node_modules/crypt3/.gitignore rename to node_modules/crypt3/.npmignore diff --git a/node_modules/crypt3/node_modules/nan/package.json b/node_modules/crypt3/node_modules/nan/package.json index 689d4cb37..a01f32dc8 100644 --- a/node_modules/crypt3/node_modules/nan/package.json +++ b/node_modules/crypt3/node_modules/nan/package.json @@ -50,14 +50,30 @@ "xtend": "~4.0.0" }, "license": "MIT", - "readme": "Native Abstractions for Node.js\n===============================\n\n**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.11, and eventually 0.12.**\n\n***Current version: 1.3.0***\n\n*(See [nan.h](https://github.com/rvagg/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*\n\n[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/)\n\n[![Build Status](https://secure.travis-ci.org/rvagg/nan.png)](http://travis-ci.org/rvagg/nan)\n[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan)\n\nThanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/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.\n\nThis project also contains some helper utilities that make addon development a bit more pleasant.\n\n * **[News & Updates](#news)**\n * **[Usage](#usage)**\n * **[Example](#example)**\n * **[API](#api)**\n\n<\/a>\n## News & Updates\n\n### Aug-2014: 1.3.0 release\n\n* `NanCString()` and `NanRawString()` have been deprecated in favour of new NanAsciiString<\/code><\/b><\/a>, NanUtf8String<\/code><\/b><\/a> and 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.\n* Two more NanMakeCallback<\/code><\/b><\/a> overloads have been added to for parity with Node core.\n* You can now `NanNew(std::string)` (use `NanNew(std::string&)` to pass by reference)\n* NanSetTemplate<\/code><\/b><\/a>, NanSetPrototypeTemplate<\/code><\/b><\/a> and NanSetInstanceTemplate<\/code><\/b><\/a> have been added.\n\n### May-2014: 1.1.0 release\n\n* We've deprecated `NanSymbol()`, you should just use `NanNew()` now.\n* `NanNull()`, `NanUndefined()`, `NanTrue()`, `NanFalse()` all return `Local`s now.\n* `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()`.\n* `NanNew()` has received some additional overload-love so you should be able to give it many kinds of values without specifying the ``.\n* Lots of small fixes and additions to expand the V8 API coverage, *use the source, Luke*.\n\n\n### May-2014: Major changes for V8 3.25 / Node 0.11.13\n\nNode 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.\n\nBecause 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.\n\nWe 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.\n\nThe major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(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(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`.\n\nWe 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.\n\nV8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local 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.\n\n`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead.\n\nBecause `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++.\n\nThere's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details.\n\n### Dec-2013: NanCString and NanRawString\n\nTwo 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.\n\n### Nov-2013: Node 0.11.9+ breaking V8 change\n\nThe version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::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(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).\n\nFor example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`.\n\n### Nov-2013: Change to binding.gyp `\"include_dirs\"` for NAN\n\nInclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `\"<\/a>\n## Usage\n\nSimply add **NAN** as a dependency in the *package.json* of your Node addon:\n\n``` bash\n$ npm install --save nan\n```\n\nPull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files:\n\n``` python\n\"include_dirs\" : [\n \"` when compiling your addon.\n\n<\/a>\n## Example\n\nSee **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use.\n\nFor a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.\n\nCompare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work).\n\nNote that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class.\n\n```c++\n// addon.cc\n#include \n#include \n// ...\n\nusing v8::FunctionTemplate;\nusing v8::Handle;\nusing v8::Object;\nusing v8::String;\n\nvoid InitAll(Handle exports) {\n exports->Set(NanNew(\"calculateSync\"),\n NanNew(CalculateSync)->GetFunction());\n\n exports->Set(NanNew(\"calculateAsync\"),\n NanNew(CalculateAsync)->GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)\n```\n\n```c++\n// sync.h\n#include \n#include \n\nNAN_METHOD(CalculateSync);\n```\n\n```c++\n// sync.cc\n#include \n#include \n#include \"./sync.h\"\n// ...\n\nusing v8::Number;\n\n// Simple synchronous access to the `Estimate()` function\nNAN_METHOD(CalculateSync) {\n NanScope();\n\n // expect a number as the first argument\n int points = args[0]->Uint32Value();\n double est = Estimate(points);\n\n NanReturnValue(NanNew(est));\n}\n```\n\n```c++\n// async.h\n#include \n#include \n\nNAN_METHOD(CalculateAsync);\n```\n\n```c++\n// async.cc\n#include \n#include \n#include \"./async.h\"\n\n// ...\n\nusing v8::Function;\nusing v8::Local;\nusing v8::Null;\nusing v8::Number;\nusing v8::Value;\n\nclass PiWorker : public NanAsyncWorker {\n public:\n PiWorker(NanCallback *callback, int points)\n : NanAsyncWorker(callback), points(points) {}\n ~PiWorker() {}\n\n // Executed inside the worker-thread.\n // It is not safe to access V8, or V8 data structures\n // here, so everything we need for input and output\n // should go on `this`.\n void Execute () {\n estimate = Estimate(points);\n }\n\n // Executed when the async work is complete\n // this function will be run inside the main event loop\n // so it is safe to use V8 again\n void HandleOKCallback () {\n NanScope();\n\n Local argv[] = {\n NanNull()\n , NanNew(estimate)\n };\n\n callback->Call(2, argv);\n };\n\n private:\n int points;\n double estimate;\n};\n\n// Asynchronous access to the `Estimate()` function\nNAN_METHOD(CalculateAsync) {\n NanScope();\n\n int points = args[0]->Uint32Value();\n NanCallback *callback = new NanCallback(args[1].As());\n\n NanAsyncQueueWorker(new PiWorker(callback, points));\n NanReturnUndefined();\n}\n```\n\n<\/a>\n## API\n\n * NAN_METHOD<\/code><\/b><\/a>\n * NAN_GETTER<\/code><\/b><\/a>\n * NAN_SETTER<\/code><\/b><\/a>\n * NAN_PROPERTY_GETTER<\/code><\/b><\/a>\n * NAN_PROPERTY_SETTER<\/code><\/b><\/a>\n * NAN_PROPERTY_ENUMERATOR<\/code><\/b><\/a>\n * NAN_PROPERTY_DELETER<\/code><\/b><\/a>\n * NAN_PROPERTY_QUERY<\/code><\/b><\/a>\n * NAN_INDEX_GETTER<\/code><\/b><\/a>\n * NAN_INDEX_SETTER<\/code><\/b><\/a>\n * NAN_INDEX_ENUMERATOR<\/code><\/b><\/a>\n * NAN_INDEX_DELETER<\/code><\/b><\/a>\n * NAN_INDEX_QUERY<\/code><\/b><\/a>\n * NAN_WEAK_CALLBACK<\/code><\/b><\/a>\n * NAN_DEPRECATED<\/code><\/b><\/a>\n * NAN_INLINE<\/code><\/b><\/a>\n * NanNew<\/code><\/b><\/a>\n * NanUndefined<\/code><\/b><\/a>\n * NanNull<\/code><\/b><\/a>\n * NanTrue<\/code><\/b><\/a>\n * NanFalse<\/code><\/b><\/a>\n * NanReturnValue<\/code><\/b><\/a>\n * NanReturnUndefined<\/code><\/b><\/a>\n * NanReturnNull<\/code><\/b><\/a>\n * NanReturnEmptyString<\/code><\/b><\/a>\n * NanScope<\/code><\/b><\/a>\n * NanEscapableScope<\/code><\/b><\/a>\n * NanEscapeScope<\/code><\/b><\/a>\n * NanLocker<\/code><\/b><\/a>\n * NanUnlocker<\/code><\/b><\/a>\n * NanGetInternalFieldPointer<\/code><\/b><\/a>\n * NanSetInternalFieldPointer<\/code><\/b><\/a>\n * NanObjectWrapHandle<\/code><\/b><\/a>\n * NanSymbol<\/code><\/b><\/a><\/del>\n * NanGetPointerSafe<\/code><\/b><\/a>\n * NanSetPointerSafe<\/code><\/b><\/a>\n * NanRawString<\/code><\/b><\/a><\/del>\n * NanCString<\/code><\/b><\/a><\/del>\n * NanAsciiString<\/code><\/b><\/a>\n * NanUtf8String<\/code><\/b><\/a>\n * NanUcs2String<\/code><\/b><\/a>\n * NanBooleanOptionValue<\/code><\/b><\/a>\n * NanUInt32OptionValue<\/code><\/b><\/a>\n * NanError<\/code><\/b>, NanTypeError<\/code><\/b>, NanRangeError<\/code><\/b><\/a>\n * NanThrowError<\/code><\/b>, NanThrowTypeError<\/code><\/b>, NanThrowRangeError<\/code><\/b>, NanThrowError(Handle)<\/code><\/b>, NanThrowError(Handle, int)<\/code><\/b><\/a>\n * NanNewBufferHandle(char *, size_t, FreeCallback, void *)<\/code><\/b>, NanNewBufferHandle(char *, uint32_t)<\/code><\/b>, NanNewBufferHandle(uint32_t)<\/code><\/b><\/a>\n * NanBufferUse(char *, uint32_t)<\/code><\/b><\/a>\n * NanNewContextHandle<\/code><\/b><\/a>\n * NanGetCurrentContext<\/code><\/b><\/a>\n * NanHasInstance<\/code><\/b><\/a>\n * NanDisposePersistent<\/code><\/b><\/a>\n * NanAssignPersistent<\/code><\/b><\/a>\n * NanMakeWeakPersistent<\/code><\/b><\/a>\n * NanSetTemplate<\/code><\/b><\/a>\n * NanSetPrototypeTemplate<\/code><\/b><\/a>\n * NanSetInstanceTemplate<\/code><\/b><\/a>\n * NanMakeCallback<\/code><\/b><\/a>\n * NanCompileScript<\/code><\/b><\/a>\n * NanRunScript<\/code><\/b><\/a>\n * NanAdjustExternalMemory<\/code><\/b><\/a>\n * NanAddGCEpilogueCallback<\/code><\/b><\/a>\n * NanAddGCPrologueCallback<\/code><\/b><\/a>\n * NanRemoveGCEpilogueCallback<\/code><\/b><\/a>\n * NanRemoveGCPrologueCallback<\/code><\/b><\/a>\n * NanGetHeapStatistics<\/code><\/b><\/a>\n * NanCallback<\/code><\/b><\/a>\n * NanAsyncWorker<\/code><\/b><\/a>\n * NanAsyncQueueWorker<\/code><\/b><\/a>\n\n<\/a>\n### NAN_METHOD(methodname)\n\nUse `NAN_METHOD` to define your V8 accessible methods:\n\n```c++\n// .h:\nclass Foo : public node::ObjectWrap {\n ...\n\n static NAN_METHOD(Bar);\n static NAN_METHOD(Baz);\n}\n\n\n// .cc:\nNAN_METHOD(Foo::Bar) {\n ...\n}\n\nNAN_METHOD(Foo::Baz) {\n ...\n}\n```\n\nThe reason for this macro is because of the method signature change in 0.11:\n\n```c++\n// 0.10 and below:\nHandle name(const Arguments& args)\n\n// 0.11 and above\nvoid name(const FunctionCallbackInfo& args)\n```\n\nThe introduction of `FunctionCallbackInfo` brings additional complications:\n\n<\/a>\n### NAN_GETTER(methodname)\n\nUse `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`.\n\n<\/a>\n### NAN_SETTER(methodname)\n\nUse `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with.\n\n<\/a>\n### NAN_PROPERTY_GETTER(cbname)\nUse `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`.\n\n<\/a>\n### NAN_PROPERTY_SETTER(cbname)\nUse `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with.\n\n<\/a>\n### NAN_PROPERTY_ENUMERATOR(cbname)\nUse `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`.\n\n<\/a>\n### NAN_PROPERTY_DELETER(cbname)\nUse `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`.\n\n<\/a>\n### NAN_PROPERTY_QUERY(cbname)\nUse `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`.\n\n<\/a>\n### NAN_INDEX_GETTER(cbname)\nUse `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`.\n\n<\/a>\n### NAN_INDEX_SETTER(cbname)\nUse `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with.\n\n<\/a>\n### NAN_INDEX_ENUMERATOR(cbname)\nUse `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`.\n\n<\/a>\n### NAN_INDEX_DELETER(cbname)\nUse `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`.\n\n<\/a>\n### NAN_INDEX_QUERY(cbname)\nUse `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`.\n\n<\/a>\n### NAN_WEAK_CALLBACK(cbname)\n\nUse `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods. You can even access the weak callback info object through the `GetCallbackInfo()`method, but you probably should not. `Revive()` keeps the weak object alive until the next GC round.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n int *parameter = data.GetParameter();\n NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL);\n if ((*parameter)++ == 0) {\n data.Revive();\n } else {\n delete parameter;\n }\n}\n```\n\n<\/a>\n### NAN_DEPRECATED\nDeclares a function as deprecated.\n\n```c++\nstatic NAN_DEPRECATED NAN_METHOD(foo) {\n ...\n}\n```\n\n<\/a>\n### NAN_INLINE\nInlines a function.\n\n```c++\nNAN_INLINE int foo(int bar) {\n ...\n}\n```\n\n<\/a>\n### Local<T> NanNew<T>( ... )\n\nUse `NanNew` to construct almost all v8 objects and make new local handles.\n\nNote: Using NanNew with an std::string is possible, however, you should ensure\nto use the overload version (`NanNew(stdString)`) rather than the template\nversion (`NanNew(stdString)`) as there is an unnecessary\nperformance penalty to using the template version because of the inability for\ncompilers to appropriately deduce to reference types on template specialization. \n\n```c++\nLocal s = NanNew(\"value\");\n\n...\n\nPersistent o;\n\n...\n\nLocal lo = NanNew(o);\n\n```\n\n<\/a>\n### Local<Primitive> NanUndefined()\n\nUse instead of `Undefined()`\n\n<\/a>\n### Local<Primitive> NanNull()\n\nUse instead of `Null()`\n\n<\/a>\n### Local<Boolean> NanTrue()\n\nUse instead of `True()`\n\n<\/a>\n### Local<Boolean> NanFalse()\n\nUse instead of `False()`\n\n<\/a>\n### NanReturnValue(Handle<Value>)\n\nUse `NanReturnValue` when you want to return a value from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n ...\n\n NanReturnValue(NanNew(\"FooBar!\"));\n}\n```\n\nNo `return` statement required.\n\n<\/a>\n### NanReturnUndefined()\n\nUse `NanReturnUndefined` when you don't want to return anything from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnUndefined();\n}\n```\n\n<\/a>\n### NanReturnNull()\n\nUse `NanReturnNull` when you want to return `Null` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnNull();\n}\n```\n\n<\/a>\n### NanReturnEmptyString()\n\nUse `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnEmptyString();\n}\n```\n\n<\/a>\n### NanScope()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope` when you do not wish to return handles (`Handle` or `Local`) to the surrounding scope (or in functions directly exposed to V8, as they do not return values in the normal sense):\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanScope();\n\n NanReturnValue(NanNew(\"FooBar!\"));\n}\n```\n\nThis method is not directly exposed to V8, nor does it return a handle, so it uses an unescapable scope:\n\n```c++\nbool Foo::Bar() {\n NanScope();\n\n Local val = NanFalse();\n ...\n return val->Value();\n}\n```\n\n<\/a>\n### NanEscapableScope()\n\nThe separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to return a handle (`Handle` or `Local`) from the scope, this is for internal functions not directly exposed to V8:\n\n```c++\nHandle Foo::Bar() {\n NanEscapableScope();\n\n return NanEscapeScope(NanNew(\"FooBar!\"));\n}\n```\n\n<\/a>\n### Local<T> NanEscapeScope(Handle<T> value);\nUse together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`.\n\n<\/a>\n### NanLocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n<\/a>\n### NanUnlocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n<\/a>\n### void * NanGetInternalFieldPointer(Handle<Object>, int)\n\nGets a pointer to the internal field with at `index` from a V8 `Object` handle.\n\n```c++\nLocal obj;\n...\nNanGetInternalFieldPointer(obj, 0);\n```\n<\/a>\n### void NanSetInternalFieldPointer(Handle<Object>, int, void *)\n\nSets the value of the internal field at `index` on a V8 `Object` handle.\n\n```c++\nstatic Persistent dataWrapperCtor;\n...\nLocal wrapper = NanNew(dataWrapperCtor)->NewInstance();\nNanSetInternalFieldPointer(wrapper, 0, this);\n```\n\n<\/a>\n### Local<Object> NanObjectWrapHandle(Object)\n\nWhen you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`:\n\n```c++\nNanObjectWrapHandle(iterator)->Get(NanNew(\"end\"))\n```\n\n<\/a>\n### Local<String> NanSymbol(const char *)<\/del>\n\nDeprecated. Use `NanNew` instead.\nUse to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects.<\/del>\n\n```c++\nbool foo = false;\nif (obj->Has(NanNew(\"foo\")))\n foo = optionsObj->Get(NanNew(\"foo\"))->BooleanValue()\n```\n\n<\/a>\n### Type NanGetPointerSafe(Type *[, Type])\n\nA helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to.\n\n```c++\nchar *plugh(uint32_t *optional) {\n char res[] = \"xyzzy\";\n uint32_t param = NanGetPointerSafe(optional, 0x1337);\n switch (param) {\n ...\n }\n NanSetPointerSafe(optional, 0xDEADBEEF);\n} \n```\n\n<\/a>\n### bool NanSetPointerSafe(Type *, Type)\n\nA helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to.\n\n```c++\nconst char *plugh(size_t *outputsize) {\n char res[] = \"xyzzy\";\n if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) {\n ...\n }\n\n ...\n}\n```\n\n<\/a>\n### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int)<\/del>\n\nDeprecated. Use something else.\n\nWhen you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`.\nJust remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer:<\/del>\n\n```c++\nsize_t count;\nvoid* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED);\n...\ndelete[] reinterpret_cast(decoded);\n```\n\n<\/a>\n### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int])<\/del>\n\nDeprecated. Use `NanUtf8String` instead.\n\nWhen you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`.\nJust remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer:<\/del>\n\n```c++\nsize_t count;\nchar* name = NanCString(args[0], &count);\n...\ndelete[] name;\n```\n\n<\/a>\n### NanAsciiString\n\nConvert a `String` to zero-terminated, Ascii-encoded `char *`.\n\n```c++\nNAN_METHOD(foo) {\n NanScope();\n NanReturnValue(NanNew(*NanAsciiString(arg[0])));\n}\n```\n\n<\/a>\n### NanUtf8String\n\nConvert a `String` to zero-terminated, Utf8-encoded `char *`.\n\n```c++\nNAN_METHOD(foo) {\n NanScope();\n NanReturnValue(NanNew(*NanUtf8String(arg[0])));\n}\n```\n\n<\/a>\n### NanUcs2String\n\nConvert a `String` to zero-terminated, Ucs2-encoded `uint16_t *`.\n\n```c++\nNAN_METHOD(foo) {\n NanScope();\n NanReturnValue(NanNew(*NanUcs2String(arg[0])));\n}\n```\n\n<\/a>\n### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool])\n\nWhen you have an \"options\" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`.\n\nThe optional last parameter is the *default* value, which is `false` if left off:\n\n```c++\n// `foo` is false unless the user supplies a truthy value for it\nbool foo = NanBooleanOptionValue(optionsObj, NanNew(\"foo\"));\n// `bar` is true unless the user supplies a falsy value for it\nbool bar = NanBooleanOptionValueDefTrue(optionsObj, NanNew(\"bar\"), true);\n```\n\n<\/a>\n### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t)\n\nSimilar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer.\n\nRequires all 3 arguments as a default is not optional:\n\n```c++\nuint32_t count = NanUInt32OptionValue(optionsObj, NanNew(\"count\"), 1024);\n```\n\n<\/a>\n### NanError(message), NanTypeError(message), NanRangeError(message)\n\nFor making `Error`, `TypeError` and `RangeError` objects.\n\n```c++\nLocal res = NanError(\"you must supply a callback argument\");\n```\n\n<\/a>\n### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int)\n\nFor throwing `Error`, `TypeError` and `RangeError` objects.\n\n```c++\nNanThrowError(\"you must supply a callback argument\");\n```\n\nCan also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`.\n\n<\/a>\n### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t)\n\nThe `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation:\n\n```c++\nNanNewBufferHandle((char*)value.data(), value.size());\n```\n\nCan also be used to initialize a `Buffer` with just a `size` argument.\n\nCan also be supplied with a `NanFreeCallback` and a hint for the garbage collector.\n\n<\/a>\n### Local<Object> NanBufferUse(char*, uint32_t)\n\n`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data.\nWhile it was possible to get around this, it required a shim by passing a\ncallback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove\nneeding to use this shim.\n\n`NanBufferUse` uses the `char*` passed as the backing data, and will free the\nmemory automatically when the weak callback is called. Keep this in mind, as\ncareless use can lead to \"double free or corruption\" and other cryptic failures.\n\n<\/a>\n### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>)\n\nCan be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for.\n\n<\/a>\n### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>])\nCreates a new `Local` handle.\n\n```c++\nLocal ftmpl = NanNew();\nLocal otmpl = ftmpl->InstanceTemplate();\nLocal ctx = NanNewContextHandle(NULL, otmpl);\n```\n\n<\/a>\n### Local<Context> NanGetCurrentContext()\n\nGets the current context.\n\n```c++\nLocal ctx = NanGetCurrentContext();\n```\n\n<\/a>\n### void NanDisposePersistent(Persistent<T> &)\n\nUse `NanDisposePersistent` to dispose a `Persistent` handle.\n\n```c++\nNanDisposePersistent(persistentHandle);\n```\n\n<\/a>\n### NanAssignPersistent(handle, object)\n\nUse `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier.\n\nIn general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`:\n\n```c++\nPersistent persistentHandle;\n\n...\n\nLocal obj = NanNew();\nobj->Set(NanNew(\"key\"), keyHandle); // where keyHandle might be a Local\nNanAssignPersistent(persistentHandle, obj)\n```\n\n<\/a>\n### _NanWeakCallbackInfo<T, P>* NanMakeWeakPersistent(Handle<T>, P*, _NanWeakCallbackInfo<T, P>::Callback)\n\nCreates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n\n...\n\n}\n\nLocal func;\n\n...\n\nint *parameter = new int(0);\nNanMakeWeakPersistent(func, parameter, &weakCallback);\n```\n\n<\/a>\n### NanSetTemplate(templ, name, value [, attributes])\n\nUse to add properties on object and function templates.\n\n<\/a>\n### NanSetPrototypeTemplate(templ, name, value [, attributes])\n\nUse to add prototype properties on function templates.\n\n<\/a>\n### NanSetInstanceTemplate(templ, name, value [, attributes])\n\nUse to add instance properties on function templates.\n\n<\/a>\n### NanMakeCallback(target, func, argc, argv)\n\nUse instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions.\n\n<\/a>\n### NanCompileScript(Handle s [, const ScriptOrigin& origin])\n\nUse to create new scripts bound to the current context.\n\n<\/a>\n### NanRunScript(script)\n\nUse to run both bound and unbound scripts.\n\n<\/a>\n### NanAdjustExternalMemory(int change_in_bytes)\n\nSimply does `AdjustAmountOfExternalAllocatedMemory`, note that the argument and returned value have type `int`.\n\n<\/a>\n### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCEpilogueCallback`\n\n<\/a>\n### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCPrologueCallback`\n\n<\/a>\n### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback)\n\nSimply does `RemoveGCEpilogueCallback`\n\n<\/a>\n### NanRemoveGCPrologueCallback(GCPrologueCallback callback)\n\nSimply does `RemoveGCPrologueCallback`\n\n<\/a>\n### NanGetHeapStatistics(HeapStatistics *heap_statistics)\n\nSimply does `GetHeapStatistics`\n\n<\/a>\n### NanCallback\n\nBecause of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`.\n\n```c++\nLocal callbackHandle = args[0].As();\nNanCallback *callback = new NanCallback(callbackHandle);\n// pass `callback` around and it's safe from GC until you:\ndelete callback;\n```\n\nYou can execute the callback like so:\n\n```c++\n// no arguments:\ncallback->Call(0, NULL);\n\n// an error argument:\nHandle argv[] = {\n NanError(NanNew(\"fail!\"))\n};\ncallback->Call(1, argv);\n\n// a success argument:\nHandle argv[] = {\n NanNull(),\n NanNew(\"w00t!\")\n};\ncallback->Call(2, argv);\n```\n\n`NanCallback` also has a `Local GetCallback()` method that you can use\nto fetch a local handle to the underlying callback function, as well as a\n`void SetFunction(Handle)` for setting the callback on the\n`NanCallback`. You can check if a `NanCallback` is empty with the `bool IsEmpty()` method. Additionally a generic constructor is available for using\n`NanCallback` without performing heap allocations.\n\n<\/a>\n### NanAsyncWorker\n\n`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress.\n\nSee a rough outline of the implementation:\n\n```c++\nclass NanAsyncWorker {\npublic:\n NanAsyncWorker (NanCallback *callback);\n\n // Clean up persistent handles and delete the *callback\n virtual ~NanAsyncWorker ();\n\n // Check the `ErrorMessage()` and call HandleOKCallback()\n // or HandleErrorCallback depending on whether it has been set or not\n virtual void WorkComplete ();\n\n // You must implement this to do some async work. If there is an\n // error then use `SetErrorMessage()` to set an error message and the callback will\n // be passed that string in an Error object\n virtual void Execute ();\n\n // Save a V8 object in a Persistent handle to protect it from GC\n void SaveToPersistent(const char *key, Local &obj);\n\n // Fetch a stored V8 object (don't call from within `Execute()`)\n Local GetFromPersistent(const char *key);\n\n // Get the error message (or NULL)\n const char *ErrorMessage();\n\n // Set an error message\n void SetErrorMessage(const char *msg);\n\nprotected:\n // Default implementation calls the callback function with no arguments.\n // Override this to return meaningful data\n virtual void HandleOKCallback ();\n\n // Default implementation calls the callback function with an Error object\n // wrapping the `errmsg` string\n virtual void HandleErrorCallback ();\n};\n```\n\n<\/a>\n### NanAsyncQueueWorker(NanAsyncWorker *)\n\n`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`.\n\n### Contributors\n\nNAN is only possible due to the excellent work of the following contributors:\n\n\n
Rod Vagg<\/th>GitHub/rvagg<\/a><\/td>Twitter/@rvagg<\/a><\/td><\/tr>\n
Benjamin Byholm<\/th>GitHub/kkoopa<\/a><\/td>-<\/td><\/tr>\n
Trevor Norris<\/th>GitHub/trevnorris<\/a><\/td>Twitter/@trevnorris<\/a><\/td><\/tr>\n
Nathan Rajlich<\/th>GitHub/TooTallNate<\/a><\/td>Twitter/@TooTallNate<\/a><\/td><\/tr>\n
Brett Lawson<\/th>GitHub/brett19<\/a><\/td>Twitter/@brett19x<\/a><\/td><\/tr>\n
Ben Noordhuis<\/th>GitHub/bnoordhuis<\/a><\/td>Twitter/@bnoordhuis<\/a><\/td><\/tr>\n<\/tbody><\/table>\n\nLicence & copyright\n-----------------------\n\nCopyright (c) 2014 NAN contributors (listed above).\n\nNative Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n", - "readmeFilename": "README.md", + "gitHead": "e482fbe142e58373d5a24f4e5a60c61e22a13f83", "bugs": { "url": "https://github.com/rvagg/nan/issues" }, "homepage": "https://github.com/rvagg/nan", "_id": "nan@1.3.0", "_shasum": "9a5b8d5ef97a10df3050e59b2c362d3baf779742", - "_from": "nan@~1.3.0", - "_resolved": "https://registry.npmjs.org/nan/-/nan-1.3.0.tgz" + "_from": "nan@>=1.3.0 <1.4.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "9a5b8d5ef97a10df3050e59b2c362d3baf779742", + "tarball": "http://localhost:4873/nan/-/nan-1.3.0.tgz" + }, + "directories": {}, + "_resolved": "http://localhost:4873/nan/-/nan-1.3.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/crypt3/package.json b/node_modules/crypt3/package.json index 331d403c8..913542f71 100644 --- a/node_modules/crypt3/package.json +++ b/node_modules/crypt3/package.json @@ -1,6 +1,6 @@ { "name": "crypt3", - "version": "0.1.5", + "version": "0.1.6", "description": "Node.js crypt(3) bindings", "main": "index.js", "scripts": { @@ -20,21 +20,39 @@ "blowfish", "hash" ], - "dependencies": { "nan": "~1.3.0" }, + "dependencies": { + "nan": "~1.3.0" + }, "author": { "name": "Jaakko-Heikki Heusala", "email": "jheusala@iki.fi" }, "license": "MIT", "gypfile": true, - "readme": "node-crypt3\n===========\n\n[crypt3link]: https://en.wikipedia.org/wiki/Crypt_(C) \"crypt() in C\"\n\n[crypt(3)][crypt3link] for Node.js\n\nInstallation\n------------\n\nInstall using `npm install crypt3` and use:\n\n```javascript\nvar crypt = require('crypt3');\n```\n\nExample password check\n----------------------\n\n```javascript\nif( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh', '$1$SrkubyRm$DEQU3KupUxt4yfhbK1HyV/') !== '$1$SrkubyRm$DEQU3KupUxt4yfhbK1HyV/' ) {\n\tconsole.error('Access denied!');\n\treturn;\n}\n```\n\nExample password encoding\n-------------------------\n\nUse `crypt(key[, salt])`:\n\n```javascript\nconsole.log( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh') ); // Salt generated automatically using default SHA512\nconsole.log( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh', crypt.createSalt('md5') ) ); // MD5 salt\nconsole.log( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh', crypt.createSalt('blowfish') ) ); // Blowfish salt (only some Linux distros)\nconsole.log( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh', crypt.createSalt('sha256') ) ); // SHA-256\nconsole.log( crypt('6Xz7sS6fEmnWScMb6Ayf363e5cdqF4Kh', crypt.createSalt('sha512') ) ); // SHA-512\n```\n\nCreate hashes\n-------------\n\nUse `crypt.createSalt([type=sha512])` where type is one of `md5`, `blowfish`, `sha256` or `sha512` (default). \n", - "readmeFilename": "README.md", + "gitHead": "8b47b4a2f542a7d9a80a62870ef3e4af0d751b33", "bugs": { "url": "https://github.com/sendanor/node-crypt3/issues" }, "homepage": "https://github.com/sendanor/node-crypt3", - "_id": "crypt3@0.1.5", - "_shasum": "f21e9ba7a57736f47e0654ad27f8668966de02db", - "_resolved": "git://github.com/sendanor/node-crypt3.git#9b893c95ed956adc3da681b125c371112b1ad31d", - "_from": "crypt3@git://github.com/sendanor/node-crypt3.git" + "_id": "crypt3@0.1.6", + "_shasum": "1f3c0124f2987eb736d731b578f5c7756a2f9f3f", + "_from": "crypt3@>=0.1.6 <1.0.0-0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "jhh", + "email": "jhh@sendanor.com" + }, + "maintainers": [ + { + "name": "jhh", + "email": "jhh@sendanor.com" + } + ], + "dist": { + "shasum": "1f3c0124f2987eb736d731b578f5c7756a2f9f3f", + "tarball": "http://registry.npmjs.org/crypt3/-/crypt3-0.1.6.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/crypt3/-/crypt3-0.1.6.tgz", + "readme": "ERROR: No README data found!" } diff --git a/package.yaml b/package.yaml index d81255b72..4b9813805 100644 --- a/package.yaml +++ b/package.yaml @@ -56,7 +56,7 @@ optionalDependencies: # those are native modules that could fail to compile # and unavailable on windows fs-ext: '>=0.3.2 <1.0.0-0' - crypt3: 'git://github.com/sendanor/node-crypt3.git' # for sinopia-htpasswd + crypt3: '>=0.1.6 <1.0.0-0' # for sinopia-htpasswd # Policy for now: # - small, unstable and rarely updated libraries (i.e. crypt3) get bundled