Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

addon-tools-raub

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addon-tools-raub - npm Package Compare versions

Comparing version 0.1.9 to 1.0.0

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc