addon-tools-raub
Advanced tools
Comparing version 0.1.9 to 1.0.0
{ | ||
"author": "Luis Blanco <luisblanco1337@gmail.com>", | ||
"name": "addon-tools-raub", | ||
"version": "0.1.9", | ||
"version": "1.0.0", | ||
"description": "Helpers for Node.js addons and dependency packages", | ||
@@ -31,4 +31,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"nan": "2.10.0" | ||
"nan": "~2.10.0" | ||
} | ||
} |
@@ -10,2 +10,3 @@ # Addon Tools | ||
* `consoleLog()` C++ implementation. | ||
* `EventEmitter` C++ implementation. | ||
@@ -40,2 +41,4 @@ * C++ macros and shortcuts. | ||
[Function consoleLog](#function-consolelog) | ||
--- | ||
@@ -673,3 +676,3 @@ | ||
## class EventEmitter | ||
## Class EventEmitter | ||
@@ -756,1 +759,21 @@ A C++ implementation of [Events API](https://nodejs.org/api/events.html). | ||
</details> | ||
--- | ||
## Function consoleLog | ||
In C++ addons, the use of **iostream** is discouraged because **Node.js** has its own | ||
perspective on **stdout** behavior. | ||
At first it may look as if `cout << "msg" << endl;` works nice, but it doesn't. | ||
After a while, it just ceases on a midword, and you end up thinking something has | ||
broken really hard in your addon. | ||
To overcome this, we can use some V8 `eval` magic to make a real `console.log` | ||
call from C++ land. And this is where `consoleLog` comes into play. | ||
* `inline void consoleLog(int argc, V8_VAR_VAL *argv)` - a generic logger, | ||
receives any set of arguments. | ||
* `inline void consoleLog(const std::string &message)` - an alias to log a single | ||
string. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
54794
1
776
Updatednan@~2.10.0