{"name":"slumber","version":"0.2.1","description":"Port of Python's slumber library -- A library that makes consuming a RESTful API easier and more convenient","main":"lib/index.js","directories":{"example":"examples","test":"tests"},"scripts":{"test":"./node_modules/mocha/bin/mocha tests","watch-test":"./node_modules/mocha/bin/mocha -w tests","build":"./node_modules/coffee-script/bin/cake build","watch":"./node_modules/coffee-script/bin/cake watch"},"repository":{"type":"git","url":"https://github.com/moul/node-slumber"},"dependencies":{"request":"2.27","querystring":"0.2.0","debug":"0.7","yamljs":"0.1"},"devDependencies":{"coffee-script":"","mocha":"","express":"","freeport":"","url":"0.7","yamljs":"0.1","connect":"2"},"optionalDependencies":{"yamljs":"0.1"},"keywords":["slumber","python","api","request","rest","json","yaml","restful"],"author":{"name":"Manfred Touron","email":"m@42.am"},"license":"MIT","bugs":{"url":"https://github.com/moul/node-slumber/issues"},"homepage":"https://github.com/moul/node-slumber","_id":"slumber@0.2.1","dist":{"shasum":"410c8f830efe1bc16c9af972aca43655dac4ef9d","tarball":"http://registry-npm.ywwl.com/slumber/download/slumber-0.2.1.tgz","integrity":"sha512-USKVAAxN34+E5v+bl93J/jR9UAb6XDSbYodGISTejimooiFHgHW7AKRf5dZj2zE/Yz8b/aUTOSH5OFul5QTQUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIHGnPEmnMAFQYDfhJBAOGSvlAiekKGSmMlSCPhaa8MAiAOBO/b0xvVFinhhzUrxCash8HFsqzzVkDfTqDpJikiZg=="}],"size":10321,"noattachment":false,"key":"/slumber/-/slumber-0.2.1.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"m42am","email":"m@42.am"},"maintainers":[{"name":"m42am","email":"m@42.am"}],"readme":"Slumber (Node.js version)\n=========================\n\n[![Build Status](https://travis-ci.org/moul/node-slumber.png?branch=master)](https://travis-ci.org/moul/node-slumber)\n[![Dependency Status](https://david-dm.org/moul/node-slumber.png?theme=shields.io)](https://david-dm.org/moul/node-slumber)\n\n![NPM Badge](https://nodei.co/npm/slumber.png?downloads=true&stars=true \"NPM Badge\")\n\nPort of the Python's [slumber](https://github.com/dstufft/slumber) library in Node.js -- A library that makes consuming a RESTful API easier and more convenient\n\nNode's Slumber is a Node.js library that provides convenient yet powerful object-oriented interface to RESTful APIs.\nIt acts as a wrapper around the excellent [request](https://github.com/mikeal/request) library and abstracts away the handling of URLs, serialization, and request processing.\n\nQuickStart\n----------\n\n1. Install Node's Slumber\n\n    ```bash\n    $ npm install slumber\n    ```\n\n2. Use Node's Slumber\n\nUsage in CoffeeScript\n---------------------\n\n```coffee\nslumber = require 'slumber'\n\n# Connect to http://slumber.in/api/v1/ with the Basic Auth user/password of demo/demo\napi = slumber.API 'http://slumber.in/api/v1/', { auth: ['demo', 'demo'] }, ->\n\n  # GET http://slumber.in/api/v1/note/\n  #     Note: Any kwargs passed to get(), post(), put(), delete() will be used as url parameters\n  api('note').get (err, data) ->\n    console.log err, data\n\n  # ---\n\n  callback = (err, data) ->\n    console.log err, data\n\n  # POST http://slumber.in/api/v1/note/\n  new_post = api('note').post({'title': 'My Test Note', 'content': 'This is the content of my Test Note!'}, cb)\n\n  # PUT http://slumber.in/api/v1/note/{id}/\n  api('note')(new_post['id']).put({'content': 'I just changed the content of my Test Note!'}, cb)\n\n  # PATCH http://slumber.in/api/v1/note/{id}/\n  api('note')(new_post['id']).patch({'content': 'Wat!'}, cb)\n\n  # GET http://slumber.in/api/v1/note/{id}/\n  api('note')(new_post['id']).get(cb)\n\n  # DELETE http://slumber.in/api/v1/note/{id}/\n  api('note')(new_post['id']).delete(cb)\n\n  api('resource').get {username: \"example\", api_key: \"1639eb74e86717f410c640d2712557aac0e989c8\"}, cb\n\n  # GET http://slumber.in/api/v1/note/?title__startswith=Bacon\n  api('note').get(title__startswith=\"Bacon\", cb)\n```\n\nHow to use callbacks\n--------------------\n\n`node-slumber` uses a dynamic callback mechanism, based on the arity of the callback.\n\nDepending on the callback arity, you will have:\n\n- with an arity of 1: `function(err)`\n- with an arity of 2: `function(err, processedData)`\n- with an arity of 3: `function(err, fullRequestResponse, processedData)`\n\nDebug\n-----\n\n`node-slumber` uses the [debug](https://www.npmjs.com/package/debug) package.\n\nTo enable debug you can use the environment variable `DEBUG=` as :\n\n- `DEBUG='slumber:api' ...` to see debug for `node-slumber` API calls only\n- `DEBUG='slumber:*' ...` to see debug for `node-slumber`, more verbose\n- `DEBUG='*' node ...` to see debug for all modules using `debug`, extremely verbose\n\nDevelopment\n-----------\n\n[![Gitter chat](https://badges.gitter.im/moul/node-slumber.png)](https://gitter.im/moul/node-slumber)\n\nRequirements\n------------\n\n- Node.js >= v0.10\n\nSee also\n--------\n\n* Browse [examples](https://github.com/moul/node-slumber/tree/master/examples) in CoffeeScript and Javascript\n\nLicense\n-------\n\nMIT\n","publish_time":1389735584819,"_cnpm_publish_time":1389735584819,"dist-tags":{"latest":"0.11.0"}}