{"_id":"ask","_rev":"22-cf4504588336adebf9d511749040f481","name":"ask","description":"A simple, chainable way to construct HTTP requests in Node or the browser","dist-tags":{"latest":"1.5.0"},"versions":{"0.0.1":{"name":"ask","description":"ask user prompt for cake","keywords":["javascript","prompt","cake","coffeescript"],"author":{"name":"Tom Wilson"},"version":"0.0.1","licenses":[{"type":"MIT","url":"http://github.com/twilson63/ask/raw/master/LICENSE"}],"engines":{"node":">=0.2.5"},"directories":{"lib":"./lib"},"main":"./lib/ask","homepage":"http://github.com/twilson63/ask/raw/master/readme.md","repository":{"type":"git","url":"git://github.com/twilson63/ask.git"},"dependencies":{},"devDependencies":{},"_id":"ask@0.0.1","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"36524635d4ae573ba9d12cfe1f193010e7e1d2aa","tarball":"https://registry.npmjs.org/ask/-/ask-0.0.1.tgz","integrity":"sha512-Uey3ADQb5mczAgDkaZGNIOMF18QDEp/vcXVugr0cScAWfI7aQYrHLzOQaggEtLCtqPXwG/PDixtjFDLS/HIiSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHEYtFylpgDL4Tp4OGQ9hCSzztbCVGq2e3xHCZ8Kn9GgIhAI4fE0OKSLFKWvE/rX66ZUe0SeGKb6p6PqVU7t56WoWH"}]},"scripts":{}},"0.1.0":{"name":"ask","description":"ask user prompt for nodejs","keywords":["javascript","prompt","cake","coffeescript"],"author":{"name":"Tom Wilson"},"version":"0.1.0","licenses":[{"type":"MIT","url":"http://github.com/twilson63/ask/raw/master/LICENSE"}],"engines":{"node":"~0.6.x"},"directories":{"lib":"./lib"},"main":"./lib/ask","homepage":"http://github.com/twilson63/ask/raw/master/readme.md","repository":{"type":"git","url":"git://github.com/twilson63/ask.git"},"_npmUser":{"name":"twilson63","email":"tom@jackhq.com"},"_id":"ask@0.1.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"cffe19d78ba8616f5b437ddaf7fb522d11e0c486","tarball":"https://registry.npmjs.org/ask/-/ask-0.1.0.tgz","integrity":"sha512-oEDgsKrmrSvX9TIGCyBx0axUtaT3ejm3xY7iw83rGQUbTXhZAg1aY/fmWBkryjAAEITTI/7FIXEl4Dk+AZeqxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaGgh2Y1aZIa7XvK9zpMijJl31Rjey3HIVB4OdOkT5vwIhAN4u+FpCoGYNJr+Z9Db9jx3Zn/zBzl/1amUVCrozavd7"}]},"maintainers":[{"name":"twilson63","email":"tom@jackhq.com"}]},"1.1.0":{"name":"ask","version":"1.1.0","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server && npm run test-browser","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"npm run bundle-standalone && npm run bundle-angular","bundle-standalone":"build/standalone.js","bundle-angular":"build/angular.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","karma":"^0.12.24","karma-expect":"^1.1.0","karma-mocha":"^0.1.9","karma-phantomjs-launcher":"^0.1.4","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^1.21.4","mocksy":"^0.1.7","ngmin":"^0.5.0","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^0.1.5"},"gitHead":"cdc0f9870b171ff21472d66aca4d3f30ddb88512","_id":"ask@1.1.0","_shasum":"ef7c13bbe6f5ef851d4e44e1496f44e566c90265","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"twilson63","email":"tom@jackhq.com"},{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"ef7c13bbe6f5ef851d4e44e1496f44e566c90265","tarball":"https://registry.npmjs.org/ask/-/ask-1.1.0.tgz","integrity":"sha512-8/+ST4koGOOMvUosFn/mtJyzFOpUR6HUPnAg2z4tP1QujrRunOk3pJ4Fys1eZCfbG/QDjAOsP5yNWcy/IlOzeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3u71OOUSCkmqOybBTZlsQee3AIdtlvBzfQxOZVjsOOAiEAkxXBYCQMJbaSIzExXm7AwB5nU9aYAnp0LqHJKCBG0nw="}]}},"1.2.0":{"name":"ask","version":"1.2.0","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"build/standalone.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^2.0.1","mocksy":"^0.1.7","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^1.1.0"},"gitHead":"5f60591f342a136834e9912034e4c74cb45a2ecf","_id":"ask@1.2.0","_shasum":"f6c0d888ae687d2e27bade8a4222d48d883cc9b1","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"f6c0d888ae687d2e27bade8a4222d48d883cc9b1","tarball":"https://registry.npmjs.org/ask/-/ask-1.2.0.tgz","integrity":"sha512-An7CyrGFlZ5oUpcoAf/fdAjpydCcv1VWW5TDWO4fmMoIJmOi4DmY8V80FrGei+FtStp7ycQT60quIhPY816INQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBITQO/+5TMQnuyTDwSnBXUi7D4nKj7eCLGBKy5cEkrFAiEAy+9XbK2jFgdPYuf0FfkXyqK05jWDJchhH0QZ6Hb2yWI="}]}},"1.3.0":{"name":"ask","version":"1.3.0","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"build/standalone.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^2.0.1","mocksy":"^0.1.7","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^1.1.0"},"gitHead":"d380741849dfd80adeae43314821b4c33cc5b60a","_id":"ask@1.3.0","_shasum":"8d334d7224ddd475028f3b1711fdede2ed21647b","_from":".","_npmVersion":"2.1.9","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"8d334d7224ddd475028f3b1711fdede2ed21647b","tarball":"https://registry.npmjs.org/ask/-/ask-1.3.0.tgz","integrity":"sha512-bhbIfg0t6I0Z9IdvDt6w/SWpNUKpugMIAUHTawidHt7VWRZmntuZNkbmGNVGlgxm7fG8L/y0SIeaksY0940FSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDheZ0G7O8QNnJrOuXl/fLNDRizeup6CaWtAoufOUFV0wIgc2MddPQjCvpFrvBcoJrJ1PaKs8Ot0JtUKWdnLmw9pDM="}]}},"1.4.0":{"name":"ask","version":"1.4.0","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"build/standalone.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^2.0.1","mocksy":"^0.1.7","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^1.1.0","tiny-emitter":"^1.0.0"},"gitHead":"9a1b6e0970fc78a187ba6912cfdfa3da95f95591","_id":"ask@1.4.0","_shasum":"e05b92139b75bc04655b58412a825baa44b3d6ef","_from":".","_npmVersion":"2.1.17","_nodeVersion":"0.10.35","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"e05b92139b75bc04655b58412a825baa44b3d6ef","tarball":"https://registry.npmjs.org/ask/-/ask-1.4.0.tgz","integrity":"sha512-392ghO5PmaPxnp222ROexwQy5wvxH1h0c5gy0Dp4vYOfcvY4MMk3J92kcbDAn/6euGW6PXUgmT0a93zLSIqyCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDK76JCirKGUxStzrH8K/LkDf/EyvhnW2RoQ6jbsxOczAiEA3kUmC8/EJMjDrqcSj6WGfjOEFdtZVChCDPDm1209uRQ="}]}},"1.4.1":{"name":"ask","version":"1.4.1","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"build/standalone.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^2.0.1","mocksy":"^0.1.7","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^1.1.0","tiny-emitter":"^1.0.0"},"gitHead":"4ebc8fb98203da2fa62a0b765a5b334049041f5b","_id":"ask@1.4.1","_shasum":"afa3127348475461e0e0820d65df8833c0119458","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"afa3127348475461e0e0820d65df8833c0119458","tarball":"https://registry.npmjs.org/ask/-/ask-1.4.1.tgz","integrity":"sha512-LA5Q+P9PeOp967oTwOk3EmF63JXEqTkIx4U39DE98kMjBjJJXIBIG4R27KqgHRurw1OOg29xbf7wq92jv/dSug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGep6+TSf1Li1W6YktlLhkcWnu0nhL6Q4GQxwe7Q8GK7AiB094T9CfCorhfqrj3E5cQvp3Z2PWQdmVt7apMhNC/0Hw=="}]}},"1.5.0":{"name":"ask","version":"1.5.0","description":"A simple, chainable way to construct HTTP requests in Node or the browser","main":"index.js","directories":{"test":"test"},"scripts":{"test":"npm run lint && npm run build && npm run test-server","test-server":"echo '\nTesting Server:\n' && mocha test/server/**/*.js --reporter spec","test-browser":"echo '\nTesting Angular:\n\n' && ./node_modules/karma/bin/karma start karma.conf.js","lint":"jshint index.js lib/","build":"build/standalone.js"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"keywords":["request","xhr","ajax","browserify","http"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/ask/issues"},"homepage":"https://github.com/divshot/ask","devDependencies":{"browserify":"^6.0.3","chai":"^1.9.2","jshint":"^2.5.6","minify":"^1.0.3","mkdirp":"^0.5.0","mocha":"^2.0.1","mocksy":"^0.1.7","testling":"^1.7.1"},"dependencies":{"as-array":"^1.0.0","deap":"^1.0.0","httpify":"^1.0.0","join-path":"^1.0.0","mix-into":"^0.4.0","promise":"^6.0.0","slasher":"^1.1.0","tiny-emitter":"^1.0.0"},"gitHead":"60eadb979a74af863287e603b821de25ef9bcaad","_id":"ask@1.5.0","_shasum":"6f10939a6b5a5f59a5348ee3fba6319fe0595988","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"6f10939a6b5a5f59a5348ee3fba6319fe0595988","tarball":"https://registry.npmjs.org/ask/-/ask-1.5.0.tgz","integrity":"sha512-V5QNPDT0UzR0nuGiPIgV9hUTgEbtPzS6UkEmmZxWXtEfcqJEx2TbyownjcryaNzVnTWWo97zh77I3H9nD55Vqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE3Yh41bxn4hFoOMyt756S/GjwLiyGz0N5GWIHaowirGAiEAxWYneogYxW4Egs+LKr1yQigjz17VPtnfvC70OIRgAVM="}]}}},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"time":{"modified":"2022-06-13T03:32:11.620Z","created":"2011-05-14T21:34:31.330Z","0.0.1":"2011-05-14T21:34:31.781Z","0.1.0":"2011-12-15T07:20:32.489Z","1.1.0":"2014-11-06T19:47:17.024Z","1.2.0":"2014-11-24T22:42:02.803Z","1.3.0":"2014-11-24T23:31:39.917Z","1.4.0":"2015-01-22T19:13:51.732Z","1.4.1":"2015-02-11T15:24:11.858Z","1.5.0":"2015-02-24T20:55:38.266Z"},"author":{"name":"Divshot"},"repository":{"type":"git","url":"https://github.com/divshot/ask.git"},"homepage":"https://github.com/divshot/ask","keywords":["request","xhr","ajax","browserify","http"],"readme":"# ask\n\nA simple, chainable way to construct HTTP requests in Node or the browser.\n\n**Usage Environments:**\n\n* [Node]()\n* [Browser Standalone]()\n\n## Install\n\nBower\n\n```\nbower install ask --save\n```\n\nNPM\n\n```\nnpm install ask --save\n```\n\n## Usage\n\n### Include in App\n\nStandalone\n\n```html\n<script src=\"/bower_components/ask/dist/ask.js\"></script>\n```\n\nNodejs/Browserify\n\n```js\nvar ask = require('ask');\n```\n\n### How to Build Requests\n\nSimple `GET` request\n\n```js\nvar request = ask({\n  origin: '', /* default origin */\n  headers: {/* set default headers */},\n  xhrOptions: {/* default xhr options */\n});\n\n// Settings for all endpoints\nrequest\n  .origin('http://api.example.com')\n  .header('Authorzation', 'Bearer 1234')\n  .xhrOption('withCredentials', true);\n\n// Create an endpoint and customize with endpoint-specific settings\n// Returns a function to execute later\nvar getUserFriends = request\n  .get('users', 123, 'friends')\n  .query('page', 1)\n  .query('limit', 10);\n\n// Request to '/users/123/friends'\ngetUserFriends().then(function (res) {\n  var users = res.body;\n}, function (err) {\n  // err.body\n});\n```\n\nSimple `POST` request\n\n```js\nvar request = ask();\n\nrequest.origin('http://api.example.com');\n\nvar createUser = request.post('users');\n\n// Send body data with request\ncreateUser({\n  name: 'example',\n  email: 'something@aol.com'\n}).then(function (res) {\n\t// Success!\n});\n\n```\n\n## API\n\n(Coming soon)\n\n## Mocking HTTP Requests\n\nA useful feature with Ask is the ability to intercept http/xhr requests and provide custom response attributes, such as statusCode, headers, etc. This is is very helpful when testing code that uses the Ask module.\n\nBefore building a request:\n\n```js\nvar ask = require('ask');\nvar request = ask();\n\nrequest\n  .when('GET', '/some/path')\n  .respond('custom response')\n  .status(201)\n  .header('content-type', 'text/html');\n\nvar somePath = request.get('some', 'path');\n\nsomePath().then(function (res) {\n\t\n});\n```\n\n### Mocking API\n\n#### when(method, path)\n\nSet up the http mocking interceptor. Returns an object mocking helper methods\n\n* `method` - GET, POST, PUT, DELETE, etc.\n* `path` - the relative path to intercept\n\n#### respond(body)\n\nSet the response body text for the mocked request\n\n* `body` - the data to set the response to\n\n#### status(code)\n\nSet the status code of the mocked response. Any code that is greater than or equal to 400 will cause the request promise to be rejected.\n\n* `code` - a number, 200, 201, etc., that sets the statusCode of the response\n\n#### header(name, value)\n\nSet individual headers for the response. If no value is provided, the current header value is returned.\n\n* `name` - the name of the header (case-insensitive)\n* `value` - the value of the header\n\n## Build\n\nBuilds standalone version\n\n```\nnpm install\nnpm run build\n```\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```","readmeFilename":"README.md","bugs":{"url":"https://github.com/divshot/ask/issues"},"license":"MIT","users":{"iamveen":true}}