UNPKG

yunlongzha_try_nodejs

Version:

try it

1 lines 9.29 kB
{"_id":"basic-auth","_rev":"21-558740966d541f8291cdcf7f3fe16c25","name":"basic-auth","description":"node.js basic auth parser","dist-tags":{"latest":"1.0.3"},"versions":{"0.0.1":{"name":"basic-auth","version":"0.0.1","repository":{"type":"git","url":"git://github.com/visionmedia/node-basic-auth"},"description":"generic basic auth parser","keywords":["basic","auth","authorization","basicauth"],"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"license":"MIT","bugs":{"url":"https://github.com/visionmedia/node-basic-auth/issues"},"homepage":"https://github.com/visionmedia/node-basic-auth","_id":"basic-auth@0.0.1","dist":{"shasum":"31ddb65843f6c35c6fea7beb46a987cb8ce18924","tarball":"http://registry.npmjs.org/basic-auth/-/basic-auth-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{}},"1.0.0":{"name":"basic-auth","version":"1.0.0","repository":{"type":"git","url":"https://github.com/visionmedia/node-basic-auth"},"description":"generic basic auth parser","keywords":["basic","auth","authorization","basicauth"],"devDependencies":{"mocha":"*","should":"*"},"scripts":{"test":"make test"},"files":["index.js"],"license":"MIT","gitHead":"099e8c703ea3994d72240492aba9b115517cf45e","bugs":{"url":"https://github.com/visionmedia/node-basic-auth/issues"},"homepage":"https://github.com/visionmedia/node-basic-auth","_id":"basic-auth@1.0.0","_shasum":"111b2d9ff8e4e6d136b8c84ea5e096cb87351637","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"111b2d9ff8e4e6d136b8c84ea5e096cb87351637","tarball":"http://registry.npmjs.org/basic-auth/-/basic-auth-1.0.0.tgz"},"directories":{}},"1.0.1":{"name":"basic-auth","description":"node.js basic auth parser","version":"1.0.1","license":"MIT","keywords":["basic","auth","authorization","basicauth"],"repository":{"type":"git","url":"git+https://github.com/jshttp/basic-auth.git"},"devDependencies":{"istanbul":"0.3.13","mocha":"~2.2.4"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.8"},"scripts":{"test":"mocha --check-leaks --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"0eea397ee77a5170c196d031d0038c2506301f27","bugs":{"url":"https://github.com/jshttp/basic-auth/issues"},"homepage":"https://github.com/jshttp/basic-auth#readme","_id":"basic-auth@1.0.1","_shasum":"4bae1dbfbf0aec4dc5dc47a8d3675b50140f3bf8","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.0.0","_npmUser":{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},"dist":{"shasum":"4bae1dbfbf0aec4dc5dc47a8d3675b50140f3bf8","tarball":"http://registry.npmjs.org/basic-auth/-/basic-auth-1.0.1.tgz"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"directories":{}},"1.0.2":{"name":"basic-auth","description":"node.js basic auth parser","version":"1.0.2","license":"MIT","keywords":["basic","auth","authorization","basicauth"],"repository":{"type":"git","url":"https://github.com/jshttp/basic-auth"},"devDependencies":{"istanbul":"0.3.15","mocha":"1.21.5"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --check-leaks --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"5e2d7ef5bad393e17ed0035f4926846137559260","bugs":{"url":"https://github.com/jshttp/basic-auth/issues"},"homepage":"https://github.com/jshttp/basic-auth","_id":"basic-auth@1.0.2","_shasum":"42900137fb0c91462d14b3739c14bf2bb624171d","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"42900137fb0c91462d14b3739c14bf2bb624171d","tarball":"http://registry.npmjs.org/basic-auth/-/basic-auth-1.0.2.tgz"},"directories":{}},"1.0.3":{"name":"basic-auth","description":"node.js basic auth parser","version":"1.0.3","license":"MIT","keywords":["basic","auth","authorization","basicauth"],"repository":{"type":"git","url":"https://github.com/jshttp/basic-auth"},"devDependencies":{"istanbul":"0.3.17","mocha":"1.21.5"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.6"},"scripts":{"test":"mocha --check-leaks --reporter spec --bail","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"gitHead":"eec1944e5a54c907676822096d40bc7c52c0aff3","bugs":{"url":"https://github.com/jshttp/basic-auth/issues"},"homepage":"https://github.com/jshttp/basic-auth","_id":"basic-auth@1.0.3","_shasum":"41f55523e589405038ee3567958c62a5ed70551a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"dougwilson","email":"doug@somethingdoug.com"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"41f55523e589405038ee3567958c62a5ed70551a","tarball":"http://registry.npmjs.org/basic-auth/-/basic-auth-1.0.3.tgz"},"directories":{}}},"readme":"# basic-auth\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nGeneric basic auth Authorization header field parser for whatever.\n\n## Installation\n\n```\n$ npm install basic-auth\n```\n\n## API\n\n```js\nvar auth = require('basic-auth')\n```\n\n### auth(req)\n\nGet the basic auth credentials from the given request. The `Authorization`\nheader is parsed and if the header is invalid, `undefined` is returned,\notherwise an object with `name` and `pass` properties.\n\n## Example\n\nPass a node request or koa Context object to the module exported. If\nparsing fails `undefined` is returned, otherwise an object with\n`.name` and `.pass`.\n\n```js\nvar auth = require('basic-auth');\nvar user = auth(req);\n// => { name: 'something', pass: 'whatever' }\n\n```\n\n### With vanilla node.js http server\n\n```js\nvar http = require('http')\nvar auth = require('basic-auth')\n\n// Create server\nvar server = http.createServer(function (req, res) {\n var credentials = auth(req)\n\n if (!credentials || credentials.name !== 'john' || credentials.pass !== 'secret') {\n res.statusCode = 401\n res.setHeader('WWW-Authenticate', 'Basic realm=\"example\"')\n res.end('Access denied')\n } else {\n res.end('Access granted')\n }\n})\n\n// Listen\nserver.listen(3000)\n```\n\n# License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/basic-auth.svg\n[npm-url]: https://npmjs.org/package/basic-auth\n[node-version-image]: https://img.shields.io/node/v/basic-auth.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/basic-auth/master.svg\n[travis-url]: https://travis-ci.org/jshttp/basic-auth\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/basic-auth/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/basic-auth?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/basic-auth.svg\n[downloads-url]: https://npmjs.org/package/basic-auth\n","maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"time":{"modified":"2015-07-02T04:45:20.715Z","created":"2013-11-30T19:20:04.033Z","0.0.1":"2013-11-30T19:20:06.195Z","1.0.0":"2014-07-07T00:19:25.361Z","1.0.1":"2015-05-05T05:54:12.251Z","1.0.2":"2015-06-13T03:51:35.314Z","1.0.3":"2015-07-02T04:45:20.715Z"},"repository":{"type":"git","url":"https://github.com/jshttp/basic-auth"},"homepage":"https://github.com/jshttp/basic-auth","keywords":["basic","auth","authorization","basicauth"],"bugs":{"url":"https://github.com/jshttp/basic-auth/issues"},"license":"MIT","readmeFilename":"README.md","users":{"pdilyard":true,"sanketss84":true,"justintormey":true,"melliw":true,"markthethomas":true,"fabian.moron.zirfas":true,"hckhanh":true},"_attachments":{},"_etag":"\"69UJF9737OCNJ6RR9EBY7TP6K\""}