Skip to content

Commit b3fffc0

Browse files
authored
docs: fix grammar in koa vs express doc (koajs#1068)
1 parent e0abc5f commit b3fffc0

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

docs/api/context.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Context
22

3-
A Koa Context encapsulates node's `request` and `response` objects
3+
A Koa Context encapsulates Node's `request` and `response` objects
44
into a single object which provides many helpful methods for writing
55
web applications and APIs.
66
These operations are used so frequently in HTTP server development
@@ -35,7 +35,7 @@ app.use(async ctx => {
3535

3636
Node's `response` object.
3737

38-
Bypassing Koa's response handling is __not supported__. Avoid using the following node properties:
38+
Bypassing Koa's response handling is __not supported__. Avoid using the following Node properties:
3939

4040
- `res.statusCode`
4141
- `res.writeHead()`
@@ -128,7 +128,7 @@ Koa uses [http-errors](https://github.com/jshttp/http-errors) to create errors.
128128
### ctx.assert(value, [status], [msg], [properties])
129129

130130
Helper method to throw an error similar to `.throw()`
131-
when `!value`. Similar to node's [assert()](http://nodejs.org/api/assert.html)
131+
when `!value`. Similar to Node's [assert()](http://nodejs.org/api/assert.html)
132132
method.
133133

134134
```js

docs/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Koa requires __node v12__ or higher for ES2015 and async function support.
44

5-
You can quickly install a supported version of node with your favorite version manager:
5+
You can quickly install a supported version of Node with your favorite version manager:
66

77
```bash
88
$ nvm install 7
@@ -40,7 +40,7 @@ app.listen(3000);
4040
## Cascading
4141

4242
Koa middleware cascade in a more traditional way as you may be used to with similar tools -
43-
this was previously difficult to make user friendly with node's use of callbacks.
43+
this was previously difficult to make user friendly with Node's use of callbacks.
4444
However with async functions we can achieve "true" middleware. Contrasting Connect's implementation which
4545
simply passes control through series of functions until one returns, Koa invoke "downstream", then
4646
control flows back "upstream".

docs/api/request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Request
22

3-
A Koa `Request` object is an abstraction on top of node's vanilla request object,
3+
A Koa `Request` object is an abstraction on top of Node's vanilla request object,
44
providing additional functionality that is useful for every day HTTP server
55
development.
66

@@ -9,7 +9,7 @@
99
### request.header
1010

1111
Request header object. This is the same as the [`headers`](https://nodejs.org/api/http.html#http_message_headers) field
12-
on node's [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
12+
on Node's [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
1313

1414
### request.header=
1515

docs/api/response.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Response
22

3-
A Koa `Response` object is an abstraction on top of node's vanilla response object,
3+
A Koa `Response` object is an abstraction on top of Node's vanilla response object,
44
providing additional functionality that is useful for every day HTTP server
55
development.
66

@@ -21,7 +21,7 @@
2121

2222
### response.status
2323

24-
Get response status. By default, `response.status` is set to `404` unlike node's `res.statusCode` which defaults to `200`.
24+
Get response status. By default, `response.status` is set to `404` unlike Node's `res.statusCode` which defaults to `200`.
2525

2626
### response.status=
2727

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
## What custom properties do the Koa objects have?
3737

3838
Koa uses its own custom objects: `ctx`, `ctx.request`, and `ctx.response`.
39-
These objects abstract node's `req` and `res` objects with convenience methods and getters/setters.
39+
These objects abstract Node's `req` and `res` objects with convenience methods and getters/setters.
4040
Generally, properties added to these objects must obey the following rules:
4141

4242
- They must be either very commonly used and/or must do something useful

docs/koa-vs-express.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Koa vs Express
22

3-
Philosophically, Koa aims to "fix and replace node", whereas Express "augments node".
3+
Philosophically, Koa aims to "fix and replace Node", whereas Express "augments Node".
44
Koa uses promises and async functions to rid apps of callback hell and simplify error handling.
5-
It exposes its own `ctx.request` and `ctx.response` objects instead of node's `req` and `res` objects.
5+
It exposes its own `ctx.request` and `ctx.response` objects instead of Node's `req` and `res` objects.
66

7-
Express, on the other hand, augments node's `req` and `res` objects with additional properties and methods
7+
Express, on the other hand, augments Node's `req` and `res` objects with additional properties and methods
88
and includes many other "framework" features, such as routing and templating, which Koa does not.
99

10-
Thus, Koa can be viewed as an abstraction of node.js's `http` modules, where as Express is an application framework for node.js.
10+
Thus, Koa can be viewed as an abstraction of Node.js's `http` modules, where as Express is an application framework for Node.js.
1111

1212
| Feature | Koa | Express | Connect |
1313
|------------------:|-----|---------|---------|
@@ -18,10 +18,10 @@
1818
| JSONP | || |
1919

2020

21-
Thus, if you'd like to be closer to node.js and traditional node.js-style coding, you probably want to stick to Connect/Express or similar frameworks.
21+
Thus, if you'd like to be closer to Node.js and traditional Node.js-style coding, you probably want to stick to Connect/Express or similar frameworks.
2222
If you want to get rid of callbacks, use Koa.
2323

24-
As result of this different philosophy is that traditional node.js "middleware", i.e. functions of the form `(req, res, next)`, are incompatible with Koa. Your application will essentially have to be rewritten from the ground, up.
24+
As result of this different philosophy is that traditional Node.js "middleware", i.e. functions of the form `(req, res, next)`, are incompatible with Koa. Your application will essentially have to be rewritten from the ground, up.
2525

2626
## Does Koa replace Express?
2727

@@ -34,7 +34,7 @@
3434
Typically many middleware would
3535
re-implement similar features, or even worse incorrectly implement them,
3636
when features like signed cookie secrets among others are typically application-specific,
37-
not middleware specific.
37+
not middleware-specific.
3838

3939
## Does Koa replace Connect?
4040

@@ -75,18 +75,18 @@
7575

7676
For example, instead of a "body parsing" middleware, you would instead use a body parsing function.
7777

78-
### Koa abstracts node's request/response
78+
### Koa abstracts Node's request/response
7979

8080
Less hackery.
8181

8282
Better user experience.
8383

8484
Proper stream handling.
85-
85+
8686
### Koa routing (third party libraries support)
8787

8888
Since Express comes with its own routing, but Koa does not have
89-
any in-built routing, there are third party libraries available such as
89+
any built-in routing, there are third party libraries available such as
9090
koa-router and koa-route.
9191
Similarly, just like we have helmet for security in Express, for Koa
9292
we have koa-helmet available and the list goes on for Koa available third

0 commit comments

Comments
 (0)