How to Install and Uninstall node-basic-auth Package on Ubuntu 21.10 (Impish Indri)

Last updated: September 20,2024

1. Install "node-basic-auth" package

This guide let you learn how to install node-basic-auth on Ubuntu 21.10 (Impish Indri)

$ sudo apt update $ sudo apt install node-basic-auth

2. Uninstall "node-basic-auth" package

Here is a brief guide to show you how to uninstall node-basic-auth on Ubuntu 21.10 (Impish Indri):

$ sudo apt remove node-basic-auth $ sudo apt autoclean && sudo apt autoremove

3. Information about the node-basic-auth package on Ubuntu 21.10 (Impish Indri)

Package: node-basic-auth
Architecture: all
Version: 2.0.1-2
Priority: optional
Section: universe/javascript
Origin: Ubuntu
Maintainer: Ubuntu Developers
Original-Maintainer: Debian Javascript Maintainers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 20
Depends: node-safe-buffer (>= 5.1.2), nodejs (>= 6)
Filename: pool/universe/n/node-basic-auth/node-basic-auth_2.0.1-2_all.deb
Size: 5212
MD5sum: 6b043a8224a7b2e5df6a8d22bdccd6b7
SHA1: e903e844e3279770dfe7ea057103a1eaaa075f4e
SHA256: 6ae11d5b7fe149abbf8d79994fa94e1fa8430479bcd847a12482ef429a3e3e11
SHA512: 1cbbe8f0a2ea4df68c8865cdee9760ab43e1e7d99bdbec5b83998695c6b2ed72967c3d39c3bfa117a4428317f97a561bc2bb3bbdbaf52b456c3ba1e321e20eb4
Homepage: https://github.com/jshttp/basic-auth#readme
Description-en: Generic basic auth Authorization header field parser for whatever
nodejs basic auth parser module. This package is used as a dependency for node
web applications that require a simple authentication mechanism.
.
API
.
var auth = require('basic-auth')
.
auth(req)
.
Get the basic auth credentials from the given request. The Authorization header
is parsed and if the header is invalid, undefined is returned, otherwise an
object with name and pass properties.
.
auth.parse(string)
.
Parse a basic auth authorization header string. This will return an object with
name and pass properties, or undefined if the string is invalid.
.
Example
.
Pass a Node.js request object to the module export. If parsing fails undefined
is returned, otherwise an object with .name and .pass.
.
var auth = require('basic-auth')
var user = auth(req)
// => { name: 'something', pass: 'whatever' }
.
A header string from any other location can also be parsed with auth.parse,
for example a Proxy-Authorization header:
.
var auth = require('basic-auth')
var user = auth.parse(req.getHeader('Proxy-Authorization'))
Description-md5: b0c95b936743c1fd5742391a00cdb9ec