Skip to content

Commit

Permalink
Fix: some typos in documentation (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindavies8 committed Oct 26, 2020
1 parent 5c78cf6 commit c4c2065
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/async_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void MakeCallbackWithAsyncContext(const Napi::CallbackInfo& info) {
Napi::Function callback = info[0].As<Napi::Function>();
Napi::Object resource = info[1].As<Napi::Object>();

// Creat a new async context instance.
// Create a new async context instance.
Napi::AsyncContext context(info.Env(), "async_context_test", resource);

// Invoke the callback with the async context instance.
Expand Down
2 changes: 1 addition & 1 deletion doc/async_worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class EchoWorker : public AsyncWorker {
};
```

The `EchoWorker`'s contructor calls the base class' constructor to pass in the
The `EchoWorker`'s constructor calls the base class' constructor to pass in the
callback that the `Napi::AsyncWorker` base class will store persistently. When
the work on the `Napi::AsyncWorker::Execute` method is done the
`Napi::AsyncWorker::OnOk` method is called and the results return back to
Expand Down
2 changes: 1 addition & 1 deletion doc/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Napi::Boolean::Boolean();

Returns a new _empty_ `Napi::Boolean` object.

### Contructor
### Constructor

Creates a new instance of the `Napi::Boolean` object.

Expand Down
2 changes: 1 addition & 1 deletion doc/checker-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ indicating for each addon whether it is an N-API addon.
```
The tool accepts the root directory from which to start checking for Node.js
native addons as a single optional command line parameter. If ommitted it will
native addons as a single optional command line parameter. If omitted it will
start checking from the current directory (`.`).
[checker tool]: ../tools/check-napi.js
2 changes: 1 addition & 1 deletion doc/creating_a_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the route folder of the repo launch the following command:
```bash
> changelog-maker
```
* Use the output generated by **changelog maker** to pdate the [CHANGELOG.md](https://github.com/nodejs/node-addon-api/blob/master/CHANGELOG.md)
* Use the output generated by **changelog maker** to update the [CHANGELOG.md](https://github.com/nodejs/node-addon-api/blob/master/CHANGELOG.md)
following the style used in publishing the previous release.

* Add any new contributors to the "contributors" section in the package.json
Expand Down
2 changes: 1 addition & 1 deletion doc/escapable_handle_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Napi::EscapableHandleScope::~EscapableHandleScope();

Deletes the `Napi::EscapableHandleScope` instance and allows any objects/handles created
in the scope to be collected by the garbage collector. There is no
guarantee as to when the gargbage collector will do this.
guarantee as to when the garbage collector will do this.

### Escape

Expand Down
4 changes: 2 additions & 2 deletions doc/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Napi::Object Napi::Function::New(const std::initializer_list<napi_value>& args)
```

- `[in] args`: Initializer list of JavaScript values as `napi_value` representing
the arguments of the contructor function.
the arguments of the constructor function.

Returns a new JavaScript object.

Expand All @@ -245,7 +245,7 @@ object.
Napi::Object Napi::Function::New(size_t argc, const napi_value* args) const;
```

- `[in] argc`: The number of the arguments passed to the contructor function.
- `[in] argc`: The number of the arguments passed to the constructor function.
- `[in] args`: Array of JavaScript values as `napi_value` representing the
arguments of the constructor function.

Expand Down
2 changes: 1 addition & 1 deletion doc/function_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Napi::Object Napi::FunctionReference::New(const std::initializer_list<napi_value
```

- `[in] args`: Initializer list of JavaScript values as `napi_value` representing
the arguments of the contructor function.
the arguments of the constructor function.

Returns a new JavaScript object.

Expand Down
2 changes: 1 addition & 1 deletion doc/handle_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Napi::HandleScope::~HandleScope();

Deletes the `Napi::HandleScope` instance and allows any objects/handles created
in the scope to be collected by the garbage collector. There is no
guarantee as to when the gargbage collector will do this.
guarantee as to when the garbage collector will do this.

### Env

Expand Down
2 changes: 1 addition & 1 deletion doc/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Napi::Number();

Returns a new _empty_ `Napi::Number` object.

### Contructor
### Constructor

Creates a new instance of a `Napi::Number` object.

Expand Down
2 changes: 1 addition & 1 deletion doc/object_lifetime_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ a native method must be deleted before returning from that method. Since
deletion, however, care must be taken to create the scope in the right
place such that you achieve the desired lifetime.

Taking the earlier example, creating a `Napi::HandleScope` in the innner loop
Taking the earlier example, creating a `Napi::HandleScope` in the inner loop
would ensure that at most a single new value is held alive throughout the
execution of the loop:

Expand Down
4 changes: 2 additions & 2 deletions doc/prebuild_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ In order to install a native add-on it's important to have all the necessary
dependencies installed and well configured (see the [setup](setup.md) section).
The end-user will need to compile the add-on when they will do an `npm install`
and in some cases this could create problems. To avoid the compilation process it's
possible to ditribute the native add-on in pre-built form for different platform
and architectures. The prebuild tools help to create and distrubute the pre-built
possible to distribute the native add-on in pre-built form for different platform
and architectures. The prebuild tools help to create and distribute the pre-built
form of a native add-on.

The following list report known tools that are compatible with **N-API**:
Expand Down
6 changes: 3 additions & 3 deletions doc/property_descriptor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Property Descriptor

A [`Napi::Object`](object.md) can be assigned properites via its [`DefineProperty`](object.md#defineproperty) and [`DefineProperties`](object.md#defineproperties) functions, which take PropertyDescrptor(s) as their parameters. The `Napi::PropertyDescriptor` can contain either values or functions, which are then assigned to the `Napi::Object`. Note that a single instance of a `Napi::PropertyDescriptor` class can only contain either one value, or at most two functions. PropertyDescriptors can only be created through the class methods [`Accessor`](#accessor), [`Function`](#function), or [`Value`](#value), each of which return a new static instance of a `Napi::PropertyDescriptor`.
A [`Napi::Object`](object.md) can be assigned properties via its [`DefineProperty`](object.md#defineproperty) and [`DefineProperties`](object.md#defineproperties) functions, which take PropertyDescriptor(s) as their parameters. The `Napi::PropertyDescriptor` can contain either values or functions, which are then assigned to the `Napi::Object`. Note that a single instance of a `Napi::PropertyDescriptor` class can only contain either one value, or at most two functions. PropertyDescriptors can only be created through the class methods [`Accessor`](#accessor), [`Function`](#function), or [`Value`](#value), each of which return a new static instance of a `Napi::PropertyDescriptor`.

## Example

Expand Down Expand Up @@ -150,7 +150,7 @@ static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (
void *data = nullptr);
```

* `[in] env`: The environemnt in which to create this accessor.
* `[in] env`: The environment in which to create this accessor.
* `[in] object`: The object on which the accessor will be defined.
* `[in] name`: The name used for the getter function.
* `[in] getter`: A getter function.
Expand Down Expand Up @@ -199,7 +199,7 @@ static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (
void *data = nullptr);
```

* `[in] env`: The environemnt in which to create this accessor.
* `[in] env`: The environment in which to create this accessor.
* `[in] object`: The object on which the accessor will be defined.
* `[in] name`: The name of the getter and setter function.
* `[in] getter`: The getter function.
Expand Down
6 changes: 3 additions & 3 deletions doc/threadsafe_function.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ New(napi_env env,
there be no threads left using the thread-safe function after the finalize
callback completes. Must implement `void operator()(Env env, DataType* data,
Context* hint)`, skipping `data` or `hint` if they are not provided.
Can be retreived via `GetContext()`.
Can be retrieved via `GetContext()`.
- `[optional] data`: Data to be passed to `finalizeCallback`.

Returns a non-empty `Napi::ThreadSafeFunction` instance.
Expand Down Expand Up @@ -158,7 +158,7 @@ napi_status Napi::ThreadSafeFunction::Abort()
Returns one of:
- `napi_ok`: The thread-safe function has been successfully aborted.
- `napi_invalid_arg`: The thread-safe function's thread-count is zero.
- `napi_generic_failure`: A generic error occurred when attemping to abort
- `napi_generic_failure`: A generic error occurred when attempting to abort
the thread-safe function.

### BlockingCall / NonBlockingCall
Expand Down Expand Up @@ -210,7 +210,7 @@ Returns one of:
- `napi_closing`: The thread-safe function is aborted and cannot accept more
calls.
- `napi_invalid_arg`: The thread-safe function is closed.
- `napi_generic_failure`: A generic error occurred when attemping to add to the
- `napi_generic_failure`: A generic error occurred when attempting to add to the
queue.

## Example
Expand Down
4 changes: 2 additions & 2 deletions doc/version_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Returns the highest N-API version supported by Node.js runtime.
### GetNodeVersion
Retrives information about Node.js version present on the system. All the
information is stored in the `napi_node_version` structrue that is defined as
Retrieves information about Node.js version present on the system. All the
information is stored in the `napi_node_version` structure that is defined as
shown below:
```cpp
Expand Down

0 comments on commit c4c2065

Please sign in to comment.