├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jshintrc ├── .travis.yml ├── index.js ├── license ├── package.json ├── readme.md └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{package.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "esnext": true, 4 | "bitwise": true, 5 | "curly": true, 6 | "immed": true, 7 | "newcap": true, 8 | "noarg": true, 9 | "undef": true, 10 | "unused": "vars", 11 | "strict": true 12 | } 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - 'iojs' 5 | - '0.12' 6 | - '0.10' 7 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = require('got'); 4 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "got-promise", 3 | "version": "5.0.0", 4 | "description": "Promise wrapper of sindresorhus/got", 5 | "license": "MIT", 6 | "repository": "floatdrop/got-promise", 7 | "author": { 8 | "name": "Vsevolod Strukchinsky", 9 | "email": "floatdrop@gmail.com", 10 | "url": "github.com/floatdrop" 11 | }, 12 | "engines": { 13 | "node": ">=0.10.0" 14 | }, 15 | "scripts": { 16 | "test": "mocha" 17 | }, 18 | "files": [ 19 | "index.js" 20 | ], 21 | "keywords": [ 22 | "got", 23 | "promise", 24 | "bluebird" 25 | ], 26 | "dependencies": { 27 | "got": "^4.0.0" 28 | }, 29 | "devDependencies": { 30 | "mocha": "*" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # got-promise [![Build Status](https://travis-ci.org/floatdrop/got-promise.svg?branch=master)](https://travis-ci.org/floatdrop/got-promise) 2 | 3 | __Deprecated__: Use `got` directly, since it now have Promise API :tada:. 4 | 5 | ## Install 6 | 7 | ``` 8 | $ npm install --save got-promise 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```js 14 | var got = require('got-promise'); 15 | 16 | got('google.com') 17 | .then(function (res) { 18 | console.log(res.body); 19 | }) 20 | .catch(function (err) { 21 | console.error(err); 22 | console.log(err.response.body); 23 | }); 24 | 25 | got.post('google.com'); // => Promise 26 | ``` 27 | 28 | 29 | ## API 30 | 31 | Look at [sindresorhus/got](https://github.com/sindresorhus/got). 32 | 33 | ## License 34 | 35 | MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) 36 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | /* global it */ 2 | 3 | 'use strict'; 4 | 5 | var assert = require('assert'); 6 | var got = require('./'); 7 | 8 | it('got should work', function (done) { 9 | got('google.com').then(function (res) { 10 | assert.ok(res.body); 11 | done(); 12 | }, done); 13 | }); 14 | 15 | it('got.get should work', function (done) { 16 | got.get('google.com').then(function (res) { 17 | assert.ok(res.body); 18 | done(); 19 | }, done); 20 | }); 21 | --------------------------------------------------------------------------------