Skip to content

Commit

Permalink
Assorted typo fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored and MylesBorins committed Aug 16, 2019
1 parent 195b569 commit cca197f
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion locale/en/blog/release/v0.5.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: blog-post.hbs

2011.10.21, Version 0.5.10 (unstable)
<ul><li>Remove cmake build system, support for Cygwin, legacy code base, process.ENV, process.ARGV, process.memoryUsage().vsize, os.openOSHandle</li>
<li>Documentation improvments (Igor Zinkovsky, Bert Belder, Ilya Dmitrichenko, koichik, Maciej Małecki, Guglielmo Ferri, isaacs)</li>
<li>Documentation improvements (Igor Zinkovsky, Bert Belder, Ilya Dmitrichenko, koichik, Maciej Małecki, Guglielmo Ferri, isaacs)</li>
<li>Performance improvements (Daniel Ennis, Bert Belder, Ben Noordhuis) </li>
<li>Long process.title support (Ben Noordhuis)</li>
<li>net: register net.Server callback only once (Simen Brekken)</li>
Expand Down
2 changes: 1 addition & 1 deletion locale/en/blog/release/v0.5.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ layout: blog-post.hbs
<p>Documentation: <a href="https://nodejs.org/docs/v0.5.5/api/">https://nodejs.org/docs/v0.5.5/api/</a></p>
<br /><br />

<b>Update:</b> The <code>.exe</code> has a bug that results in incompatibility with Windows XP and Server 2003. This has been reported in <a href="https://github.com/joyent/node/issues/1592">issue #1592</a> and fixed. A new binary was made that is compatibile with the older Windows: <a href="https://nodejs.org/dist/v0.5.5/node-186364e.exe">https://nodejs.org/dist/v0.5.5/node-186364e.exe</a>.
<b>Update:</b> The <code>.exe</code> has a bug that results in incompatibility with Windows XP and Server 2003. This has been reported in <a href="https://github.com/joyent/node/issues/1592">issue #1592</a> and fixed. A new binary was made that is compatible with the older Windows: <a href="https://nodejs.org/dist/v0.5.5/node-186364e.exe">https://nodejs.org/dist/v0.5.5/node-186364e.exe</a>.
2 changes: 1 addition & 1 deletion locale/en/blog/release/v5.10.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ author: Myles Borins
### Notable changes

* **http**:
* Enclose IPv6 Host header in square brackets. This will enable proper seperation of the host adress from any port reference (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314)
* Enclose IPv6 Host header in square brackets. This will enable proper separation of the host address from any port reference (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314)

* **path**:
* Make win32.isAbsolute more consistent (Brian White) [#6028](https://github.com/nodejs/node/pull/6028)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ if (argv.e && argv.key) {
}
```

NODE PRO TIP: The `crypto.createCipheriv()` and `crypto.createDecipheriv()` methods do not take a password, rather a `key` and an `iv` which are combined together to form a random password. The size of the `key` and `iv` depends on the choosen algorithm. A reference to common algorithms and their `key` and `iv` size is given below:
NODE PRO TIP: The `crypto.createCipheriv()` and `crypto.createDecipheriv()` methods do not take a password, rather a `key` and an `iv` which are combined together to form a random password. The size of the `key` and `iv` depends on the chosen algorithm. A reference to common algorithms and their `key` and `iv` size is given below:

| Algorithm | Key | iv |
| ------------- |:-----------------: | :----------------: |
Expand Down
2 changes: 1 addition & 1 deletion locale/ko/about/trademark.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ goal in mind, we’ve tried to make the policy as flexible and easy to understan
as legally possible.
Please read the [full policy](/static/documents/trademark-policy.pdf).
If you have any questions don't hesistate to
If you have any questions don't hesitate to
[email us](mailto:[email protected]).
Guidelines for the visual display of the Node.js mark are described in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As an example, we are going to preform a GET request to [www.random.org/integers
callback = function(response) {
var str = '';

//another chunk of data has been recieved, so append it to `str`
//another chunk of data has been received, so append it to `str`
response.on('data', function (chunk) {
str += chunk;
});

//the whole response has been recieved, so we just print it out here
//the whole response has been received, so we just print it out here
response.on('end', function () {
console.log(str);
});
Expand Down
4 changes: 2 additions & 2 deletions locale/ru/knowledge/HTTP/servers/how-to-read-POST-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Here is a quick script that shows you how to do exactly that:

The variable `postHTML` is a static string containing the HTML for two input boxes and a submit box - this HTML is provided so that you can `POST` example data. This is NOT the right way to serve static HTML - please see [How to Serve Static Files](link) for a more proper example.

With the HTML out of the way, we [create a server](/how-do-i-create-a-http-server) to listen for requests. It is important to note, when listening for POST data, that the `req` object is also an [Event Emitter](/what-are-event-emitters). `req`, therefore, will emit a `data` event whenever a 'chunk' of incoming data is received; when there is no more incoming data, the `end` event is emitted. So, in our case, we listen for `data` events. Once all the data is recieved, we log the data to the console and send the response.
With the HTML out of the way, we [create a server](/how-do-i-create-a-http-server) to listen for requests. It is important to note, when listening for POST data, that the `req` object is also an [Event Emitter](/what-are-event-emitters). `req`, therefore, will emit a `data` event whenever a 'chunk' of incoming data is received; when there is no more incoming data, the `end` event is emitted. So, in our case, we listen for `data` events. Once all the data is received, we log the data to the console and send the response.

Something important to note is that the event listeners are being added immediately after the request object is received. If you don't immediately set them, then there is a possibility of missing some of the events. If, for example, an event listener was attached from inside a callback, then the `data` and `end` events might be fired in the meantime with no listeners attached!

You can save this script to `server.js` and run it with `node server.js`. Once you run it you will notice that occassionally you will see lines with no data, e.g. `POSTed:`. This happens because regular `GET` requests go through the same codepath. In a more 'real-world' application, it would be proper practice to check the type of request and handle the different request types differently.
You can save this script to `server.js` and run it with `node server.js`. Once you run it you will notice that occasionally you will see lines with no data, e.g. `POSTed:`. This happens because regular `GET` requests go through the same codepath. In a more 'real-world' application, it would be proper practice to check the type of request and handle the different request types differently.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Note that `basename` has an optional second parameter that will strip out the ex

Lastly, the `path` module provides methods to check whether or not a given path exists: `exists` and `existsSync` They both take the path of a file for the first parameter.

`exists` takes a callback as its second parameter, to which is returned a boolean representing the existance of the file.
`exists` takes a callback as its second parameter, to which is returned a boolean representing the existence of the file.

`existsSync`, on the other hand, checks the given path synchronously, returning the boolean directly. In Node.js, you will typically want to use the asynchronous functions for most file system I/O - the synchronous versions will block your entire process until they finish.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The node.js way to deal with the above would look a bit more like this:
function processData (callback) {
fetchData(function (err, data) {
if (err) {
console.log("An error has occured. Abort everything!");
console.log("An error has occurred. Abort everything!");
return callback(err);
}
data += 1;
Expand All @@ -41,7 +41,7 @@ The typical convention with asynchronous functions (which almost all of your fun
function asyncOperation ( a, b, c, callback ) {
// ... lots of hard work ...
if ( /* an error occurs */ ) {
return callback(new Error("An error has occured"));
return callback(new Error("An error has occurred"));
}
// ... more work ...
callback(null, d, e, f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In node.js an event can be described simply as a string with a corresponding cal
> example_emitter.emit("unhandled");
false //return value

This demonstates all the basic functionality of an EventEmitter. The `on` or `addListener` method (basically the subscription method) allows you to choose the event to watch for and the callback to be called. The `emit` method (the publish method), on the other hand, allows you to "emit" an event, which causes all callbacks registered to the event to 'fire', (get called).
This demonstrates all the basic functionality of an EventEmitter. The `on` or `addListener` method (basically the subscription method) allows you to choose the event to watch for and the callback to be called. The `emit` method (the publish method), on the other hand, allows you to "emit" an event, which causes all callbacks registered to the event to 'fire', (get called).

So in the example, we first subscribe to both the `test` and `print` events. Then we emit the `test`, `print`, and `unhandled` events. Since `unhandled` has no callback, it just returns false; the other two run all the attached callbacks and return true.

Expand Down Expand Up @@ -99,5 +99,5 @@ If you want remove a specific callback, you can use `removeListener`. If you wan
> ee.emit("event");
false

NOTE: If you want create more than 10 listeners on a single event, you will have to make a call to `ee.setMaxListeners(n)` where n is the max numbers of listeners (with zero being unlimited number of listeners). This is used to make sure you aren't accidently leaking event listeners.
NOTE: If you want create more than 10 listeners on a single event, you will have to make a call to `ee.setMaxListeners(n)` where n is the max numbers of listeners (with zero being unlimited number of listeners). This is used to make sure you aren't accidentally leaking event listeners.

2 changes: 1 addition & 1 deletion locale/ru/knowledge/getting-started/npm/what-is-npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ difficulty: 1
layout: knowledge-post.hbs
---

`npm`, short for Node Package Manager, is two things: first and foremost, it is an online repository for the publishing of open-source Node.js projects; second, it is a command-line utility for interacting with said repository that aids in package installation, version management, and dependency management. A plethora of node.js libraries and applications are published on npm, and many more are added every day. These applications can be searched for on http://search.npmjs.org/. Once you have a package you want to install, it can be installed with a single commmand-line command.
`npm`, short for Node Package Manager, is two things: first and foremost, it is an online repository for the publishing of open-source Node.js projects; second, it is a command-line utility for interacting with said repository that aids in package installation, version management, and dependency management. A plethora of node.js libraries and applications are published on npm, and many more are added every day. These applications can be searched for on http://search.npmjs.org/. Once you have a package you want to install, it can be installed with a single command-line command.


Let's say you're hard at work one day, developing the Next Great Application. You come across a problem, and you decide that it's time to use that cool library you keep hearing about - let's use Caolan McMahon's [async](https://github.com/caolan/async) as an example. Thankfully, `npm` is very simple to use: you only have to run `npm install async`, and the specified module will be installed in the current directory under `./node_modules/`. Once installed to your `node_modules` folder, you'll be able to use `require()` on them just like they were built-ins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For a more complete package.json, we can check out `underscore`:

As you can see, there are fields for the `description` and `keywords` of your projects. This allows people who find your project understand what it is in just a few words. The `author`, `contributors`, `homepage` and `repository` fields can all be used to credit the people who contributed to the project, show how to contact the author/maintainer, and give links for additional references.

The file listed in the `main` field is the main entry point for the libary; when someone runs `require(<library name>)`, require resolves this call to `require(<package.json:main>)`.
The file listed in the `main` field is the main entry point for the library; when someone runs `require(<library name>)`, require resolves this call to `require(<package.json:main>)`.

Finally, the `dependencies` field is used to list all the dependencies of your project that are available on `npm`. When someone installs your project through `npm`, all the dependencies listed will be installed as well. Additionally, if someone runs `npm install` in the root directory of your project, it will install all the dependencies to `./node_modules`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If the optional value is in the middle it can cause some undesired effects, sinc

example = function (param1, optParam, callback) {
if (typeof callback === 'undefined') {
// only two paramaters were passed, so the callback is actually in `optParam`
// only two parameters were passed, so the callback is actually in `optParam`
callback = optParam;

//give `optParam` a default value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ An example output is:
setInterval: It's been one second!
...

As you can see the parameters to both are the same. The number second paramter says how long in milliseconds to wait before calling the function passed into the first parameter. The difference between the two functions is that `setTimeout` calls the callback only once while `setInterval` will call it over and over again.
As you can see the parameters to both are the same. The number second parameter says how long in milliseconds to wait before calling the function passed into the first parameter. The difference between the two functions is that `setTimeout` calls the callback only once while `setInterval` will call it over and over again.

Typically you want to be careful with `setInterval` because it can cause some undesireable effects. If, for example, you wanted to make sure your server was up by pinging it every second, you might think to try something like this:
Typically you want to be careful with `setInterval` because it can cause some undesirable effects. If, for example, you wanted to make sure your server was up by pinging it every second, you might think to try something like this:

setInterval(ping, 1000);

This can cause problems, however, if your server is slow and it takes, say, 3 seconds to respond to the first request. In the time it takes to get back the response, you would have sent off 3 more requests - not exactly desirable! This isn't the end of the world when serving small static files, but if you doing an expensive operation such as database query or any complicated computation this can have some undiserable results. A common solution looks like this:
This can cause problems, however, if your server is slow and it takes, say, 3 seconds to respond to the first request. In the time it takes to get back the response, you would have sent off 3 more requests - not exactly desirable! This isn't the end of the world when serving small static files, but if you doing an expensive operation such as database query or any complicated computation this can have some undesirable results. A common solution looks like this:

var recursive = function () {
console.log("It has been one second!");
Expand Down
4 changes: 2 additions & 2 deletions locale/ru/knowledge/javascript-conventions/what-is-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ try/catch block.
Notice that the only complex values allowed in JSON are objects and
arrays. Functions, dates and other types are excluded. This may not
seem to make sense at first. But remember that JSON is a data format,
not a format for transfering complex javascript objects along with
not a format for transferring complex javascript objects along with
their functionality.

## JSON in other languages

Although JSON was inspired by the simplicity of javascript data
structures, it's use is not limited to the javascript language. Many
other languages have methods of transfering native hashes and lists
other languages have methods of transferring native hashes and lists
into stringified JSON objects. Here's a quick example in ruby.

require 'json'
Expand Down
2 changes: 1 addition & 1 deletion locale/uk/about/trademark.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ goal in mind, we’ve tried to make the policy as flexible and easy to understan
as legally possible.

Please read the [full policy](/static/documents/trademark-policy.pdf).
If you have any questions don't hesistate to
If you have any questions don't hesitate to
[email us](mailto:[email protected]).

Guidelines for the visual display of the Node.js mark are described in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ As an example, we are going to preform a GET request to [www.random.org/integers
callback = function(response) {
var str = '';

//another chunk of data has been recieved, so append it to `str`
//another chunk of data has been received, so append it to `str`
response.on('data', function (chunk) {
str += chunk;
});

//the whole response has been recieved, so we just print it out here
//the whole response has been received, so we just print it out here
response.on('end', function () {
console.log(str);
});
Expand Down
4 changes: 2 additions & 2 deletions locale/uk/knowledge/HTTP/servers/how-to-read-POST-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Here is a quick script that shows you how to do exactly that:

The variable `postHTML` is a static string containing the HTML for two input boxes and a submit box - this HTML is provided so that you can `POST` example data. This is NOT the right way to serve static HTML - please see [How to Serve Static Files](link) for a more proper example.

With the HTML out of the way, we [create a server](/how-do-i-create-a-http-server) to listen for requests. It is important to note, when listening for POST data, that the `req` object is also an [Event Emitter](/what-are-event-emitters). `req`, therefore, will emit a `data` event whenever a 'chunk' of incoming data is received; when there is no more incoming data, the `end` event is emitted. So, in our case, we listen for `data` events. Once all the data is recieved, we log the data to the console and send the response.
With the HTML out of the way, we [create a server](/how-do-i-create-a-http-server) to listen for requests. It is important to note, when listening for POST data, that the `req` object is also an [Event Emitter](/what-are-event-emitters). `req`, therefore, will emit a `data` event whenever a 'chunk' of incoming data is received; when there is no more incoming data, the `end` event is emitted. So, in our case, we listen for `data` events. Once all the data is received, we log the data to the console and send the response.

Something important to note is that the event listeners are being added immediately after the request object is received. If you don't immediately set them, then there is a possibility of missing some of the events. If, for example, an event listener was attached from inside a callback, then the `data` and `end` events might be fired in the meantime with no listeners attached!

You can save this script to `server.js` and run it with `node server.js`. Once you run it you will notice that occassionally you will see lines with no data, e.g. `POSTed:`. This happens because regular `GET` requests go through the same codepath. In a more 'real-world' application, it would be proper practice to check the type of request and handle the different request types differently.
You can save this script to `server.js` and run it with `node server.js`. Once you run it you will notice that occasionally you will see lines with no data, e.g. `POSTed:`. This happens because regular `GET` requests go through the same codepath. In a more 'real-world' application, it would be proper practice to check the type of request and handle the different request types differently.

Loading

0 comments on commit cca197f

Please sign in to comment.