{"id":16697504,"url":"https://github.com/thisandagain/basic","last_synced_at":"2025-03-23T14:31:44.116Z","repository":{"id":9137969,"uuid":"10928438","full_name":"thisandagain/basic","owner":"thisandagain","description":"HTTP Basic Authentication for Node.js","archived":false,"fork":false,"pushed_at":"2020-03-20T03:56:16.000Z","size":1734,"stargazers_count":10,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-04-14T12:10:26.620Z","etag":null,"topics":["authentication","basic-authentication","http","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thisandagain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-25T04:42:34.000Z","updated_at":"2019-07-11T15:50:06.000Z","dependencies_parsed_at":"2022-08-30T10:32:11.917Z","dependency_job_id":null,"html_url":"https://github.com/thisandagain/basic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisandagain%2Fbasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisandagain%2Fbasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisandagain%2Fbasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thisandagain%2Fbasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thisandagain","download_url":"https://codeload.github.com/thisandagain/basic/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245115988,"owners_count":20563263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","basic-authentication","http","javascript"],"created_at":"2024-10-12T17:48:03.117Z","updated_at":"2025-03-23T14:31:43.759Z","avatar_url":"https://github.com/thisandagain.png","language":"JavaScript","readme":"## basic\n#### [HTTP Basic Auth](http://www.ietf.org/rfc/rfc2617.txt) for Node.js\n\n[![Build Status](https://travis-ci.org/thisandagain/basic.svg?branch=master)](https://travis-ci.org/thisandagain/basic)\n[![Greenkeeper badge](https://badges.greenkeeper.io/thisandagain/basic.svg)](https://greenkeeper.io/)\n\n### Installation\n```bash\nnpm install basic\n```\n\n### Basic Use\n```javascript\nvar http = require('http');\nvar basic = require('../../lib/index');\n\nvar auth = basic(function (user, pass, callback) {\n    if (user === 'let' \u0026\u0026 pass === 'me in') return callback(null);\n    callback(401);\n});\n\nhttp.createServer(function (req, res) {\n    auth(req, res, function (err) {\n        var head = (err) ? {'WWW-Authenticate': 'Basic realm=\"Secure Area\"'} : {};\n        res.writeHead(err || 200, head);\n        res.end();\n    });\n}).listen(8000);\n```\n\n```bash\ncurl --head -H \"Authorization:Basic bGV0Om1lIGlu\" http://localhost:8000\n```\n\n### Testing\n```bash\nnpm test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisandagain%2Fbasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthisandagain%2Fbasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthisandagain%2Fbasic/lists"}