Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2019-09-01 09:08:20 +0300
committerMichaƫl Zasso <targos@protonmail.com>2019-09-20 10:30:20 +0300
commit835d1cabf6fb492f207d94391fc6feaf4029fab4 (patch)
treeb7c12f3d721aaec7caed0dd48e8950ce07c11d59 /doc/api
parent8023e43e1d5bdfb70a26f766e205a581039d8170 (diff)
doc: start unorded lists at start of line
Address Markdownlint MD006 rule. Can flag when list items aren't indented far enough. PR-URL: https://github.com/nodejs/node/pull/29390 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/addons.md56
-rw-r--r--doc/api/buffer.md10
-rw-r--r--doc/api/child_process.md26
-rw-r--r--doc/api/n-api.md103
-rw-r--r--doc/api/repl.md22
5 files changed, 109 insertions, 108 deletions
diff --git a/doc/api/addons.md b/doc/api/addons.md
index b0bb330d32b..59d708a71f7 100644
--- a/doc/api/addons.md
+++ b/doc/api/addons.md
@@ -17,34 +17,34 @@ for more information on N-API.
When not using N-API, implementing Addons is complicated,
involving knowledge of several components and APIs:
- - V8: the C++ library Node.js currently uses to provide the
- JavaScript implementation. V8 provides the mechanisms for creating objects,
- calling functions, etc. V8's API is documented mostly in the
- `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source
- tree), which is also available [online][v8-docs].
-
- - [libuv][]: The C library that implements the Node.js event loop, its worker
- threads and all of the asynchronous behaviors of the platform. It also
- serves as a cross-platform abstraction library, giving easy, POSIX-like
- access across all major operating systems to many common system tasks, such
- as interacting with the filesystem, sockets, timers, and system events. libuv
- also provides a pthreads-like threading abstraction that may be used to
- power more sophisticated asynchronous Addons that need to move beyond the
- standard event loop. Addon authors are encouraged to think about how to
- avoid blocking the event loop with I/O or other time-intensive tasks by
- off-loading work via libuv to non-blocking system operations, worker threads
- or a custom use of libuv's threads.
-
- - Internal Node.js libraries. Node.js itself exports a number of C++ APIs
- that Addons can use &mdash; the most important of which is the
- `node::ObjectWrap` class.
-
- - Node.js includes a number of other statically linked libraries including
- OpenSSL. These other libraries are located in the `deps/` directory in the
- Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are
- purposefully re-exported by Node.js and may be used to various extents by
- Addons.
- See [Linking to Node.js' own dependencies][] for additional information.
+- V8: the C++ library Node.js currently uses to provide the
+ JavaScript implementation. V8 provides the mechanisms for creating objects,
+ calling functions, etc. V8's API is documented mostly in the
+ `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source
+ tree), which is also available [online][v8-docs].
+
+- [libuv][]: The C library that implements the Node.js event loop, its worker
+ threads and all of the asynchronous behaviors of the platform. It also
+ serves as a cross-platform abstraction library, giving easy, POSIX-like
+ access across all major operating systems to many common system tasks, such
+ as interacting with the filesystem, sockets, timers, and system events. libuv
+ also provides a pthreads-like threading abstraction that may be used to
+ power more sophisticated asynchronous Addons that need to move beyond the
+ standard event loop. Addon authors are encouraged to think about how to
+ avoid blocking the event loop with I/O or other time-intensive tasks by
+ off-loading work via libuv to non-blocking system operations, worker threads
+ or a custom use of libuv's threads.
+
+- Internal Node.js libraries. Node.js itself exports a number of C++ APIs
+ that Addons can use &mdash; the most important of which is the
+ `node::ObjectWrap` class.
+
+- Node.js includes a number of other statically linked libraries including
+ OpenSSL. These other libraries are located in the `deps/` directory in the
+ Node.js source tree. Only the libuv, OpenSSL, V8 and zlib symbols are
+ purposefully re-exported by Node.js and may be used to various extents by
+ Addons.
+ See [Linking to Node.js' own dependencies][] for additional information.
All of the following examples are available for [download][] and may
be used as the starting-point for an Addon.
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index 46bba08ef15..2a254380f2b 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -1363,11 +1363,11 @@ changes:
If `value` is:
- * a string, `value` is interpreted according to the character encoding in
- `encoding`.
- * a `Buffer` or [`Uint8Array`][], `value` will be used in its entirety.
- To compare a partial `Buffer`, use [`buf.slice()`][].
- * a number, `value` will be interpreted as an unsigned 8-bit integer
+* a string, `value` is interpreted according to the character encoding in
+ `encoding`.
+* a `Buffer` or [`Uint8Array`][], `value` will be used in its entirety.
+ To compare a partial `Buffer`, use [`buf.slice()`][].
+* a number, `value` will be interpreted as an unsigned 8-bit integer
value between `0` and `255`.
```js
diff --git a/doc/api/child_process.md b/doc/api/child_process.md
index 8348cad4ae0..1a9436637e8 100644
--- a/doc/api/child_process.md
+++ b/doc/api/child_process.md
@@ -43,19 +43,19 @@ and asynchronous alternatives to [`child_process.spawn()`][] and
[`child_process.spawnSync()`][]. Each of these alternatives are implemented on
top of [`child_process.spawn()`][] or [`child_process.spawnSync()`][].
- * [`child_process.exec()`][]: spawns a shell and runs a command within that
- shell, passing the `stdout` and `stderr` to a callback function when
- complete.
- * [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except
- that it spawns the command directly without first spawning a shell by
- default.
- * [`child_process.fork()`][]: spawns a new Node.js process and invokes a
- specified module with an IPC communication channel established that allows
- sending messages between parent and child.
- * [`child_process.execSync()`][]: a synchronous version of
- [`child_process.exec()`][] that will block the Node.js event loop.
- * [`child_process.execFileSync()`][]: a synchronous version of
- [`child_process.execFile()`][] that will block the Node.js event loop.
+* [`child_process.exec()`][]: spawns a shell and runs a command within that
+ shell, passing the `stdout` and `stderr` to a callback function when
+ complete.
+* [`child_process.execFile()`][]: similar to [`child_process.exec()`][] except
+ that it spawns the command directly without first spawning a shell by
+ default.
+* [`child_process.fork()`][]: spawns a new Node.js process and invokes a
+ specified module with an IPC communication channel established that allows
+ sending messages between parent and child.
+* [`child_process.execSync()`][]: a synchronous version of
+ [`child_process.exec()`][] that will block the Node.js event loop.
+* [`child_process.execFileSync()`][]: a synchronous version of
+ [`child_process.execFile()`][] that will block the Node.js event loop.
For certain use cases, such as automating shell scripts, the
[synchronous counterparts][] may be more convenient. In many cases, however,
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index d4a8ebf1594..280e12c58e1 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -4029,35 +4029,36 @@ napi_status napi_define_class(napi_env env,
napi_value* result);
```
- - `[in] env`: The environment that the API is invoked under.
- - `[in] utf8name`: Name of the JavaScript constructor function; this is
- not required to be the same as the C++ class name, though it is recommended
- for clarity.
- - `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH`
-if it is null-terminated.
- - `[in] constructor`: Callback function that handles constructing instances
- of the class. (This should be a static method on the class, not an actual
- C++ constructor function.)
- - `[in] data`: Optional data to be passed to the constructor callback as
- the `data` property of the callback info.
- - `[in] property_count`: Number of items in the `properties` array argument.
- - `[in] properties`: Array of property descriptors describing static and
- instance data properties, accessors, and methods on the class
- See `napi_property_descriptor`.
- - `[out] result`: A `napi_value` representing the constructor function for
- the class.
+- `[in] env`: The environment that the API is invoked under.
+- `[in] utf8name`: Name of the JavaScript constructor function; this is
+ not required to be the same as the C++ class name, though it is recommended
+ for clarity.
+- `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH`
+ if it is null-terminated.
+- `[in] constructor`: Callback function that handles constructing instances
+ of the class. (This should be a static method on the class, not an actual
+ C++ constructor function.)
+- `[in] data`: Optional data to be passed to the constructor callback as
+ the `data` property of the callback info.
+- `[in] property_count`: Number of items in the `properties` array argument.
+- `[in] properties`: Array of property descriptors describing static and
+ instance data properties, accessors, and methods on the class
+ See `napi_property_descriptor`.
+- `[out] result`: A `napi_value` representing the constructor function for
+ the class.
Returns `napi_ok` if the API succeeded.
Defines a JavaScript class that corresponds to a C++ class, including:
- - A JavaScript constructor function that has the class name and invokes the
- provided C++ constructor callback.
- - Properties on the constructor function corresponding to _static_ data
- properties, accessors, and methods of the C++ class (defined by
- property descriptors with the `napi_static` attribute).
- - Properties on the constructor function's `prototype` object corresponding to
- _non-static_ data properties, accessors, and methods of the C++ class
- (defined by property descriptors without the `napi_static` attribute).
+
+- A JavaScript constructor function that has the class name and invokes the
+ provided C++ constructor callback.
+- Properties on the constructor function corresponding to _static_ data
+ properties, accessors, and methods of the C++ class (defined by
+ property descriptors with the `napi_static` attribute).
+- Properties on the constructor function's `prototype` object corresponding to
+ _non-static_ data properties, accessors, and methods of the C++ class
+ (defined by property descriptors without the `napi_static` attribute).
The C++ constructor callback should be a static method on the class that calls
the actual class constructor, then wraps the new C++ instance in a JavaScript
@@ -4091,16 +4092,16 @@ napi_status napi_wrap(napi_env env,
napi_ref* result);
```
- - `[in] env`: The environment that the API is invoked under.
- - `[in] js_object`: The JavaScript object that will be the wrapper for the
- native object.
- - `[in] native_object`: The native instance that will be wrapped in the
- JavaScript object.
- - `[in] finalize_cb`: Optional native callback that can be used to free the
- native instance when the JavaScript object is ready for garbage-collection.
- - `[in] finalize_hint`: Optional contextual hint that is passed to the
- finalize callback.
- - `[out] result`: Optional reference to the wrapped object.
+- `[in] env`: The environment that the API is invoked under.
+- `[in] js_object`: The JavaScript object that will be the wrapper for the
+ native object.
+- `[in] native_object`: The native instance that will be wrapped in the
+ JavaScript object.
+- `[in] finalize_cb`: Optional native callback that can be used to free the
+ native instance when the JavaScript object is ready for garbage-collection.
+- `[in] finalize_hint`: Optional contextual hint that is passed to the
+ finalize callback.
+- `[out] result`: Optional reference to the wrapped object.
Returns `napi_ok` if the API succeeded.
@@ -4145,9 +4146,9 @@ napi_status napi_unwrap(napi_env env,
void** result);
```
- - `[in] env`: The environment that the API is invoked under.
- - `[in] js_object`: The object associated with the native instance.
- - `[out] result`: Pointer to the wrapped native instance.
+- `[in] env`: The environment that the API is invoked under.
+- `[in] js_object`: The object associated with the native instance.
+- `[out] result`: Pointer to the wrapped native instance.
Returns `napi_ok` if the API succeeded.
@@ -4172,9 +4173,9 @@ napi_status napi_remove_wrap(napi_env env,
void** result);
```
- - `[in] env`: The environment that the API is invoked under.
- - `[in] js_object`: The object associated with the native instance.
- - `[out] result`: Pointer to the wrapped native instance.
+- `[in] env`: The environment that the API is invoked under.
+- `[in] js_object`: The object associated with the native instance.
+- `[out] result`: Pointer to the wrapped native instance.
Returns `napi_ok` if the API succeeded.
@@ -4200,16 +4201,16 @@ napi_status napi_add_finalizer(napi_env env,
napi_ref* result);
```
- - `[in] env`: The environment that the API is invoked under.
- - `[in] js_object`: The JavaScript object to which the native data will be
- attached.
- - `[in] native_object`: The native data that will be attached to the JavaScript
- object.
- - `[in] finalize_cb`: Native callback that will be used to free the
- native data when the JavaScript object is ready for garbage-collection.
- - `[in] finalize_hint`: Optional contextual hint that is passed to the
- finalize callback.
- - `[out] result`: Optional reference to the JavaScript object.
+- `[in] env`: The environment that the API is invoked under.
+- `[in] js_object`: The JavaScript object to which the native data will be
+ attached.
+- `[in] native_object`: The native data that will be attached to the JavaScript
+ object.
+- `[in] finalize_cb`: Native callback that will be used to free the
+ native data when the JavaScript object is ready for garbage-collection.
+- `[in] finalize_hint`: Optional contextual hint that is passed to the
+ finalize callback.
+- `[out] result`: Optional reference to the JavaScript object.
Returns `napi_ok` if the API succeeded.
diff --git a/doc/api/repl.md b/doc/api/repl.md
index b53c39dab20..75be841490e 100644
--- a/doc/api/repl.md
+++ b/doc/api/repl.md
@@ -601,17 +601,17 @@ undefined
Various behaviors of the Node.js REPL can be customized using the following
environment variables:
- - `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history
- will be saved to the specified file rather than `.node_repl_history` in the
- user's home directory. Setting this value to `''` (an empty string) will
- disable persistent REPL history. Whitespace will be trimmed from the value.
- On Windows platforms environment variables with empty values are invalid so
- set this variable to one or more spaces to disable persistent REPL history.
- - `NODE_REPL_HISTORY_SIZE` - Controls how many lines of history will be
- persisted if history is available. Must be a positive number.
- **Default:** `1000`.
- - `NODE_REPL_MODE` - May be either `'sloppy'` or `'strict'`. **Default:**
- `'sloppy'`, which will allow non-strict mode code to be run.
+- `NODE_REPL_HISTORY` - When a valid path is given, persistent REPL history
+ will be saved to the specified file rather than `.node_repl_history` in the
+ user's home directory. Setting this value to `''` (an empty string) will
+ disable persistent REPL history. Whitespace will be trimmed from the value.
+ On Windows platforms environment variables with empty values are invalid so
+ set this variable to one or more spaces to disable persistent REPL history.
+- `NODE_REPL_HISTORY_SIZE` - Controls how many lines of history will be
+ persisted if history is available. Must be a positive number.
+ **Default:** `1000`.
+- `NODE_REPL_MODE` - May be either `'sloppy'` or `'strict'`. **Default:**
+ `'sloppy'`, which will allow non-strict mode code to be run.
### Persistent History