Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 26, 2015
1 parent 9bc36b0 commit f0a3f0c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# editorconfig.org
root = true

[*]
Expand All @@ -8,7 +7,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
[{package.json,*.yml}]
indent_style = space
indent_size = 2

Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text eol=lf
* text=auto
11 changes: 2 additions & 9 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true
"unused": "vars",
"strict": true
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"request",
"util",
"utility",
"simple"
"simple",
"curl",
"wget",
"fetch"
],
"dependencies": {
"duplexify": "^3.2.0",
Expand Down
17 changes: 9 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module.

It also supports following redirects, streams, and automagically handling gzip/deflate.
It supports following redirects, streams, automagically handling gzip/deflate and some convenience options.

Created because [`request`](https://github.com/mikeal/request) is bloated *(several megabytes!)* and slow.


## Install

```sh
```
$ npm install --save got
```

Expand Down Expand Up @@ -54,22 +54,22 @@ Type: `object`

Any of the [`http.request`](http://nodejs.org/api/http.html#http_http_request_options_callback) options.

##### options.encoding
###### encoding

Type: `string`, `null`
Default: `'utf8'`

Encoding to be used on `setEncoding` of the response data. If null, the body is returned as a Buffer.

##### options.body
###### body

Type: `string`, `Buffer`, `ReadableStream`

_This option and stream mode are mutually exclusive._

Body, that will be sent with `POST` request. If present in `options` and `options.method` is not set - `options.method` will be set to `POST`.

##### options.json
###### json

Type: `Boolean`
Default: `false`
Expand All @@ -78,19 +78,19 @@ _This option and stream mode are mutually exclusive._

If enabled, response body will be parsed with `JSON.parse`.

##### options.query
###### query

Type: `string`, `Object`

Query string object, that will be added to request url. This will override query string in `url`.

##### options.timeout
###### timeout

Type: `number`

Milliseconds after which the request will be aborted and an error event with `ETIMEDOUT` code will be emitted.

##### options.agent
###### agent

[http.Agent](http://nodejs.org/api/http.html#http_class_http_agent) instance.

Expand Down Expand Up @@ -168,6 +168,7 @@ got('todomvc.com', {
* [`gh-got`](https://github.com/sindresorhus/gh-got) - Convenience wrapper for interacting with the GitHub API
* [`got-promise`](https://github.com/floatdrop/got-promise) - Promise wrapper


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)

0 comments on commit f0a3f0c

Please sign in to comment.