| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 45c70a9 commit 381c6cd
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,16 +34,14 @@ involving knowledge of several components and APIs: | |||
| 34 | 34 | off-loading work via libuv to non-blocking system operations, worker threads | |
| 35 | 35 | or a custom use of libuv's threads. | |
| 36 | 36 | ||
| 37 | - * Internal Node.js libraries. Node.js itself exports a number of C++ APIs | ||
| 38 | - that Addons can use — the most important of which is the | ||
| 39 | - `node::ObjectWrap` class. | ||
| 37 | + * Internal Node.js libraries. Node.js itself exports C++ APIs that Addons can | ||
| 38 | + use, the most important of which is the `node::ObjectWrap` class. | ||
| 40 | 39 | ||
| 41 | - * Node.js includes a number of other statically linked libraries including | ||
| 42 | - OpenSSL. These other libraries are located in the `deps/` directory in the | ||
| 43 | - Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are | ||
| 44 | - purposefully re-exported by Node.js and may be used to various extents by | ||
| 45 | - Addons. | ||
| 46 | - See [Linking to Node.js' own dependencies][] for additional information. | ||
| 40 | + * Node.js includes other statically linked libraries including OpenSSL. These | ||
| 41 | + other libraries are located in the `deps/` directory in the Node.js source | ||
| 42 | + tree. Only the libuv, OpenSSL, V8 and zlib symbols are purposefully | ||
| 43 | + re-exported by Node.js and may be used to various extents by Addons. See | ||
| 44 | + [Linking to Node.js' own dependencies][] for additional information. | ||
| 47 | 45 | ||
| 48 | 46 | All of the following examples are available for [download][] and may | |
| 49 | 47 | be used as the starting-point for an Addon. | |
@@ -331,12 +329,12 @@ try { | |||
| 331 | 329 | ||
| 332 | 330 | ### Linking to Node.js' own dependencies | |
| 333 | 331 | ||
| 334 | - Node.js uses a number of statically linked libraries such as V8, libuv and | ||
| 335 | - OpenSSL. All Addons are required to link to V8 and may link to any of the | ||
| 336 | - other dependencies as well. Typically, this is as simple as including | ||
| 337 | - the appropriate `#include <...>` statements (e.g. `#include <v8.h>`) and | ||
| 338 | - `node-gyp` will locate the appropriate headers automatically. However, there | ||
| 339 | - are a few caveats to be aware of: | ||
| 332 | + Node.js uses statically linked libraries such as V8, libuv and OpenSSL. All | ||
| 333 | + Addons are required to link to V8 and may link to any of the other dependencies | ||
| 334 | + as well. Typically, this is as simple as including the appropriate | ||
| 335 | + `#include <...>` statements (e.g. `#include <v8.h>`) and `node-gyp` will locate | ||
| 336 | + the appropriate headers automatically. However, there are a few caveats to be | ||
| 337 | + aware of: | ||
| 340 | 338 | ||
| 341 | 339 | * When `node-gyp` runs, it will detect the specific release version of Node.js | |
| 342 | 340 | and download either the full source tarball or just the headers. If the full | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -622,8 +622,7 @@ packet is allowed to travel through, specifically for multicast traffic. Each | |||
| 622 | 622 | router or gateway that forwards a packet decrements the TTL. If the TTL is | |
| 623 | 623 | decremented to 0 by a router, it will not be forwarded. | |
| 624 | 624 | ||
| 625 | - The argument passed to `socket.setMulticastTTL()` is a number of hops | ||
| 626 | - between 0 and 255. The default on most systems is `1` but can vary. | ||
| 625 | + The `ttl` argument may be between 0 and 255. The default on most systems is `1`. | ||
| 627 | 626 | ||
| 628 | 627 | ### socket.setRecvBufferSize(size) | |
| 629 | 628 | <!-- YAML | |
@@ -658,8 +657,8 @@ travel through. Each router or gateway that forwards a packet decrements the | |||
| 658 | 657 | TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. | |
| 659 | 658 | Changing TTL values is typically done for network probes or when multicasting. | |
| 660 | 659 | ||
| 661 | - The argument to `socket.setTTL()` is a number of hops between 1 and 255. | ||
| 662 | - The default on most systems is 64 but can vary. | ||
| 660 | + The `ttl` argument may be between between 1 and 255. The default on most systems | ||
| 661 | + is 64. | ||
| 663 | 662 | ||
| 664 | 663 | ### socket.unref() | |
| 665 | 664 | <!-- YAML | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,9 +13,9 @@ to be global but are not. They exist only in the scope of modules, see the | |||
| 13 | 13 | * [`module`][] | |
| 14 | 14 | * [`require()`][] | |
| 15 | 15 | ||
| 16 | - The objects listed here are specific to Node.js. There are a number of | ||
| 17 | - [built-in objects][] that are part of the JavaScript language itself, which are | ||
| 18 | - also globally accessible. | ||
| 16 | + The objects listed here are specific to Node.js. There are [built-in objects][] | ||
| 17 | + that are part of the JavaScript language itself, which are also globally | ||
| 18 | + accessible. | ||
| 19 | 19 | ||
| 20 | 20 | ## Class: Buffer | |
| 21 | 21 | <!-- YAML | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,9 +83,9 @@ by checking `require.main.filename`. | |||
| 83 | 83 | <!-- type=misc --> | |
| 84 | 84 | ||
| 85 | 85 | The semantics of Node.js's `require()` function were designed to be general | |
| 86 | - enough to support a number of reasonable directory structures. Package manager | ||
| 87 | - programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to | ||
| 88 | - build native packages from Node.js modules without modification. | ||
| 86 | + enough to support reasonable directory structures. Package manager programs | ||
| 87 | + such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to build | ||
| 88 | + native packages from Node.js modules without modification. | ||
| 89 | 89 | ||
| 90 | 90 | Below we give a suggested directory structure that could work: | |
| 91 | 91 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | 5 | > Stability: 2 - Stable | |
| 6 | 6 | ||
| 7 | - The `os` module provides a number of operating system-related utility methods. | ||
| 8 | - It can be accessed using: | ||
| 7 | + The `os` module provides operating system-related utility methods. It can be | ||
| 8 | + accessed using: | ||
| 9 | 9 | ||
| 10 | 10 | ```js | |
| 11 | 11 | const os = require('os'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1108,11 +1108,10 @@ The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. | |||
| 1108 | 1108 | added: v10.0.0 | |
| 1109 | 1109 | --> | |
| 1110 | 1110 | ||
| 1111 | - `util.types` provides a number of type checks for different kinds of built-in | ||
| 1112 | - objects. Unlike `instanceof` or `Object.prototype.toString.call(value)`, | ||
| 1113 | - these checks do not inspect properties of the object that are accessible from | ||
| 1114 | - JavaScript (like their prototype), and usually have the overhead of | ||
| 1115 | - calling into C++. | ||
| 1111 | + `util.types` provides type checks for different kinds of built-in objects. | ||
| 1112 | + Unlike `instanceof` or `Object.prototype.toString.call(value)`, these checks do | ||
| 1113 | + not inspect properties of the object that are accessible from JavaScript (like | ||
| 1114 | + their prototype), and usually have the overhead of calling into C++. | ||
| 1116 | 1115 | ||
| 1117 | 1116 | The result generally does not make any guarantees about what kinds of | |
| 1118 | 1117 | properties or behavior a value exposes in JavaScript. They are primarily | |
| Back | FazBrowse Home | New Git URL |
0 commit comments