Browse Source

minor tweaks

http2
Sindre Sorhus 10 years ago
parent
commit
f0a3f0c5e4
  1. 3
      .editorconfig
  2. 2
      .gitattributes
  3. 11
      .jshintrc
  4. 5
      package.json
  5. 17
      readme.md

3
.editorconfig

@ -1,4 +1,3 @@
# editorconfig.org
root = true
[*]
@ -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

2
.gitattributes

@ -1 +1 @@
* text eol=lf
* text=auto

11
.jshintrc

@ -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
package.json

@ -36,7 +36,10 @@
"request",
"util",
"utility",
"simple"
"simple",
"curl",
"wget",
"fetch"
],
"dependencies": {
"duplexify": "^3.2.0",

17
readme.md

@ -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
```
@ -54,14 +54,14 @@ 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`
@ -69,7 +69,7 @@ _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`
@ -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.
@ -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)

Loading…
Cancel
Save