├── .gitignore ├── .travis.yml ├── errors.js ├── lib └── rp.js ├── .npmignore ├── test ├── .eslintrc.json └── spec │ └── request-test.js ├── .publishrc ├── .editorconfig ├── LICENSE ├── README.md ├── package.json ├── gulpfile.js └── .eslintrc.json /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /coverage/ 3 | /node_modules/ 4 | 5 | .DS_Store 6 | npm-debug.log -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | 4 | node_js: 5 | - "0.10" 6 | - "0.12" 7 | - "iojs" 8 | - "4" 9 | - "6" 10 | -------------------------------------------------------------------------------- /errors.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | throw new Error('DO NOT USE request-promise-bluebird! Use request-promise instead. It uses Bluebird under the hood.'); 4 | -------------------------------------------------------------------------------- /lib/rp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | throw new Error('DO NOT USE request-promise-bluebird! Use request-promise instead. It uses Bluebird under the hood.'); 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /coverage/ 3 | /test/ 4 | 5 | /.editorconfig 6 | /.eslintrc.json 7 | /.gitignore 8 | /.publishrc 9 | /.travis.yml 10 | /gulpfile.js 11 | 12 | .DS_Store 13 | npm-debug.log -------------------------------------------------------------------------------- /test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "mocha": true 4 | }, 5 | "globals": { 6 | "expect": true 7 | }, 8 | "rules": { 9 | 10 | // Variables 11 | 12 | "no-undefined": 0, 13 | 14 | // Node.js and CommonJS 15 | 16 | "no-process-env": 0, 17 | "no-sync": 0 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.publishrc: -------------------------------------------------------------------------------- 1 | { 2 | "validations": { 3 | "vulnerableDependencies": true, 4 | "uncommittedChanges": true, 5 | "untrackedFiles": true, 6 | "sensitiveData": true, 7 | "branch": "master", 8 | "gitTag": true 9 | }, 10 | "confirm": true, 11 | "publishTag": "latest", 12 | "prePublishScript": "npm run test-publish" 13 | } -------------------------------------------------------------------------------- /test/spec/request-test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | 4 | describe('Request-Promise-Bluebird', function () { 5 | 6 | it('should throw when it is required', function () { 7 | 8 | expect(function () { 9 | require('../../'); 10 | }).to.throw(); 11 | 12 | }); 13 | 14 | it('should throw when the errors are required', function () { 15 | 16 | expect(function () { 17 | require('../../errors'); 18 | }).to.throw(); 19 | 20 | }); 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | 9 | [*.js] 10 | indent_style = space 11 | indent_size = 4 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | [*.{json,xml}] 16 | indent_style = space 17 | indent_size = 2 18 | trim_trailing_whitespace = true 19 | insert_final_newline = true 20 | 21 | [*.{md,txt}] 22 | indent_style = space 23 | indent_size = 4 24 | trim_trailing_whitespace = false 25 | insert_final_newline = false -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2016, Nicolai Kamenzky and contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Promises/A+ logo 3 | 4 | 5 | # Request-Promise-Bluebird 6 | 7 | [![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request-promise?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 8 | [![Build Status](https://img.shields.io/travis/request/request-promise-bluebird/master.svg?style=flat-square)](https://travis-ci.org/request/request-promise-bluebird) 9 | [![Coverage Status](https://img.shields.io/coveralls/request/request-promise-bluebird.svg?style=flat-square)](https://coveralls.io/r/request/request-promise-bluebird) 10 | [![Dependency Status](https://img.shields.io/gemnasium/request/request-promise-bluebird.svg?style=flat-square)](https://gemnasium.com/github.com/request/request-promise-bluebird) 11 | [![Known Vulnerabilities](https://snyk.io/test/npm/request-promise-bluebird/badge.svg?style=flat-square)](https://snyk.io/test/npm/request-promise-bluebird) 12 | 13 | **DO NOT USE `request-promise-bluebird`!** Use [`request-promise`](https://www.npmjs.com/package/request-promise) instead. It uses Bluebird under the hood. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "request-promise-bluebird", 3 | "version": "0.0.2", 4 | "description": "The simplified HTTP request client 'request' with Promise support. Powered by 'bluebird'.", 5 | "keywords": [ 6 | "xhr", 7 | "http", 8 | "https", 9 | "promise", 10 | "request", 11 | "then", 12 | "thenable", 13 | "bluebird" 14 | ], 15 | "main": "./lib/rp.js", 16 | "scripts": { 17 | "test": "./node_modules/.bin/gulp ci", 18 | "test-publish": "./node_modules/.bin/gulp ci-no-cov", 19 | "publish-please": "publish-please", 20 | "prepublish": "publish-please guard" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/request/request-promise-bluebird.git" 25 | }, 26 | "author": "Nicolai Kamenzky (https://github.com/analog-nico)", 27 | "license": "ISC", 28 | "bugs": { 29 | "url": "https://github.com/request/request-promise-bluebird/issues" 30 | }, 31 | "homepage": "https://github.com/request/request-promise-bluebird#readme", 32 | "engines": { 33 | "node": ">=0.10.0" 34 | }, 35 | "dependencies": {}, 36 | "devDependencies": { 37 | "chai": "~3.5.0", 38 | "chalk": "~1.1.3", 39 | "gulp": "~3.9.1", 40 | "gulp-coveralls": "~0.1.4", 41 | "gulp-eslint": "~2.1.0", 42 | "gulp-istanbul": "~1.0.0", 43 | "gulp-mocha": "~2.2.0", 44 | "lodash": "~4.13.1", 45 | "publish-please": "~2.1.4", 46 | "rimraf": "~2.5.3", 47 | "run-sequence": "~1.2.2" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var runSequence = require('run-sequence'); 5 | var istanbul = require('gulp-istanbul'); 6 | var mocha = require('gulp-mocha'); 7 | var chalk = require('chalk'); 8 | var rimraf = require('rimraf'); 9 | var coveralls = require('gulp-coveralls'); 10 | var eslint = require('gulp-eslint'); 11 | var _ = require('lodash'); 12 | 13 | var chai = require('chai'); 14 | global.expect = chai.expect; 15 | 16 | 17 | var paths = { 18 | libJsFiles: ['./lib/**/*.js', './errors.js'], 19 | specFiles: './test/spec/**/*.js', 20 | fixtureFiles: './test/fixtures/**/*.js', 21 | gulpfile: './gulpfile.js', 22 | eslintrc: './.eslintrc.json' 23 | }; 24 | 25 | 26 | gulp.task('dev', ['watch', 'validate']); 27 | 28 | gulp.task('watch', function () { 29 | 30 | gulp.watch(_.flatten([ 31 | paths.libJsFiles, 32 | paths.specFiles, 33 | paths.fixtureFiles, 34 | paths.gulpfile 35 | ]), [ 36 | 'validate' 37 | ]); 38 | 39 | gulp.watch(_.flatten([ 40 | paths.eslintrc 41 | ]), [ 42 | 'lint' 43 | ]); 44 | 45 | }); 46 | 47 | gulp.task('validate', function (done) { 48 | runSequence('lint', 'test', done); 49 | }); 50 | 51 | gulp.task('lint', function () { 52 | 53 | return gulp.src(_.flatten([ 54 | paths.libJsFiles, 55 | paths.gulpfile, 56 | paths.specFiles, 57 | paths.fixtureFiles, 58 | paths.gulpfile 59 | ])) 60 | .pipe(eslint()) 61 | .pipe(eslint.format()) 62 | .pipe(eslint.failAfterError()); 63 | 64 | }); 65 | 66 | gulp.task('test', ['clean'], function (done) { 67 | 68 | var coverageVariable = '$$cov_' + new Date().getTime() + '$$'; 69 | 70 | gulp.src(paths.libJsFiles) 71 | .pipe(istanbul({ 72 | coverageVariable: coverageVariable 73 | })) 74 | .pipe(istanbul.hookRequire()) 75 | .on('finish', function () { 76 | 77 | gulp.src(paths.specFiles) 78 | .pipe(mocha()) 79 | .on('error', function (err) { 80 | console.error(String(err)); 81 | console.error(chalk.bold.bgRed(' TESTS FAILED ')); 82 | done(new Error(' TESTS FAILED ')); 83 | }) 84 | .pipe(istanbul.writeReports({ 85 | reporters: ['lcov'], 86 | coverageVariable: coverageVariable 87 | })) 88 | .on('end', done); 89 | 90 | }); 91 | 92 | }); 93 | 94 | gulp.task('test-without-coverage', function () { 95 | 96 | return gulp.src(paths.specFiles) 97 | .pipe(mocha()) 98 | .on('error', function () { 99 | console.log(chalk.bold.bgRed(' TESTS FAILED ')); 100 | }); 101 | 102 | }); 103 | 104 | gulp.task('clean', ['clean-coverage']); 105 | 106 | gulp.task('clean-coverage', function (done) { 107 | rimraf('./coverage', done); 108 | }); 109 | 110 | gulp.task('ci', function (done) { 111 | runSequence('validate', 'coveralls', 'test-without-coverage', done); 112 | }); 113 | 114 | gulp.task('ci-no-cov', function (done) { 115 | runSequence('validate', 'test-without-coverage', done); 116 | }); 117 | 118 | gulp.task('coveralls', function () { 119 | return gulp.src('coverage/**/lcov.info') 120 | .pipe(coveralls()); 121 | }); 122 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "espree", 4 | "parserOptions": { 5 | "ecmaVersion": 5, 6 | "sourceType": "script", 7 | "ecmaFeatures": {} 8 | }, 9 | "plugins": [], 10 | "env": { 11 | "node": true 12 | }, 13 | "globals": {}, 14 | "rules": { 15 | 16 | // Possible Errors (fully reviewed 2016-07-05) 17 | 18 | "no-cond-assign": 2, 19 | "no-console": 0, 20 | "no-constant-condition": 2, 21 | "no-control-regex": 2, 22 | "no-debugger": 2, 23 | "no-dupe-args": 2, 24 | "no-dupe-keys": 2, 25 | "no-duplicate-case": 2, 26 | "no-empty": [2, { "allowEmptyCatch": false }], 27 | "no-empty-character-class": 2, 28 | "no-ex-assign": 2, 29 | "no-extra-boolean-cast": 2, 30 | "no-extra-parens": [2, "all"], 31 | "no-extra-semi": 2, 32 | "no-func-assign": 2, 33 | "no-inner-declarations": [2, "functions"], 34 | "no-invalid-regexp": 2, 35 | "no-irregular-whitespace": [2, { "skipComments": false }], 36 | "no-negated-in-lhs": 2, 37 | "no-obj-calls": 2, 38 | "no-prototype-builtins": 2, 39 | "no-regex-spaces": 2, 40 | "no-sparse-arrays": 2, 41 | "no-unexpected-multiline": 2, 42 | "no-unreachable": 2, 43 | "no-unsafe-finally": 2, 44 | "use-isnan": 2, 45 | "valid-jsdoc": 0, 46 | "valid-typeof": 2, 47 | 48 | // Best Practices 49 | 50 | "accessor-pairs": 2, 51 | "curly": [2, "multi-line"], 52 | "dot-location": [2, "property"], 53 | "eqeqeq": 2, 54 | "no-caller": 2, 55 | "no-empty-pattern": 0, // for ES6 destructuring 56 | "no-eval": 2, 57 | "no-extend-native": 2, 58 | "no-extra-bind": 2, 59 | "no-fallthrough": 2, 60 | "no-floating-decimal": 2, 61 | "no-implied-eval": 2, 62 | "no-iterator": 2, 63 | "no-labels": 2, 64 | "no-lone-blocks": 2, 65 | "no-magic-numbers": 0, 66 | "no-multi-spaces": 2, 67 | "no-multi-str": 2, 68 | "no-native-reassign": 2, 69 | "no-new": 2, 70 | "no-new-func": 2, 71 | "no-new-wrappers": 2, 72 | "no-octal": 2, 73 | "no-octal-escape": 2, 74 | "no-proto": 2, 75 | "no-redeclare": 2, 76 | "no-return-assign": [2, "except-parens"], 77 | "no-self-assign": 2, 78 | "no-self-compare": 2, 79 | "no-sequences": 2, 80 | "no-throw-literal": 2, 81 | "no-unmodified-loop-condition": 2, 82 | "no-useless-call": 2, 83 | "no-useless-escape": 2, 84 | "no-with": 2, 85 | "wrap-iife": [2, "inside"], 86 | "yoda": 2, 87 | 88 | // Strict Mode (fully reviewed 2016-07-05) 89 | 90 | "strict": [2, "safe"], 91 | 92 | // Variables (fully reviewed 2016-07-05) 93 | 94 | "init-declarations": [2, "always"], 95 | "no-catch-shadow": 0, 96 | "no-delete-var": 2, 97 | "no-label-var": 2, 98 | "no-restricted-globals": 0, 99 | "no-shadow": [2, { "builtinGlobals": false, "hoist": "all", "allow": [] }], 100 | "no-shadow-restricted-names": 2, 101 | "no-undef": [2, { "typeof": true }], 102 | "no-undef-init": 2, 103 | "no-undefined": 2, 104 | "no-unused-vars": [2, { "vars": "local", "args": "none", "caughtErrors": "none" }], 105 | "no-use-before-define": [2, { "functions": false, "classes": true }], 106 | 107 | // Node.js and CommonJS (fully reviewed 2016-07-05) 108 | 109 | "callback-return": 0, 110 | "global-require": 0, 111 | "handle-callback-err": [2, "^(err|error)$" ], 112 | "no-mixed-requires": 0, 113 | "no-new-require": 2, 114 | "no-path-concat": 2, 115 | "no-process-env": 2, 116 | "no-process-exit": 2, 117 | "no-restricted-modules": 0, 118 | "no-sync": 2, 119 | 120 | // Stylistic Issues 121 | 122 | "block-spacing": 2, 123 | "brace-style": [2, "1tbs", { "allowSingleLine": true }], 124 | "camelcase": [2, { "properties": "never" }], 125 | "comma-dangle": [2, "never"], 126 | "comma-spacing": 2, 127 | "comma-style": 2, 128 | "eol-last": 2, 129 | "indent": [2, 4, { "SwitchCase": 1 }], 130 | "jsx-quotes": 0, 131 | "key-spacing": 2, 132 | "keyword-spacing": 2, 133 | "new-cap": 0, 134 | "new-parens": 2, 135 | "no-array-constructor": 2, 136 | "no-mixed-spaces-and-tabs": 2, 137 | "no-multiple-empty-lines": [2, { "max": 2, "maxBOF": 0, "maxEOF": 1 }], 138 | "no-new-object": 2, 139 | "no-plusplus": [2, { "allowForLoopAfterthoughts": false }], 140 | "no-spaced-func": 2, 141 | "no-trailing-spaces": 2, 142 | "no-unneeded-ternary": [2, { "defaultAssignment": false }], 143 | "no-whitespace-before-property": 2, 144 | "one-var": 0, 145 | "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }], 146 | "padded-blocks": 0, 147 | "quotes": [2, "single", "avoid-escape"], 148 | "semi": [2, "always"], 149 | "semi-spacing": 2, 150 | "space-before-blocks": 2, 151 | "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], 152 | "space-in-parens": 0, 153 | "space-infix-ops": 0, 154 | "space-unary-ops": 2, 155 | "spaced-comment": 0 156 | 157 | } 158 | } 159 | --------------------------------------------------------------------------------