Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yunusga/bs-auth
Browsersync basic authorization middleware plugin
https://github.com/yunusga/bs-auth
authorization authorization-middleware browser-sync browsersync browsersync-plugin middleware plugin
Last synced: about 14 hours ago
JSON representation
Browsersync basic authorization middleware plugin
- Host: GitHub
- URL: https://github.com/yunusga/bs-auth
- Owner: yunusga
- License: mit
- Created: 2017-07-21T12:31:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T14:56:23.000Z (about 3 years ago)
- Last Synced: 2024-11-11T22:15:18.959Z (1 day ago)
- Topics: authorization, authorization-middleware, browser-sync, browsersync, browsersync-plugin, middleware, plugin
- Language: JavaScript
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# bs-auth [1.1.6](https://github.com/tazau/bs-auth/blob/master/CHANGELOG.md)
[![npm](https://img.shields.io/npm/v/bs-auth.svg)](https://www.npmjs.com/package/bs-auth) [![npm](https://img.shields.io/npm/l/bs-auth.svg)](https://www.npmjs.com/package/bs-auth) [![npm](https://img.shields.io/npm/dm/bs-auth.svg)](https://www.npmjs.com/package/bs-auth)
> [Browsersync](https://browsersync.io/) basic authorization middleware plugin
## Install
`npm i browser-sync bs-auth`## Usage
```javascript
const bs = require('browser-sync').create();bs.use(require('bs-auth'), {
user: 'user',
pass: 'password'
});
```or
```javascript
const bs = require('browser-sync').create();bs.init({
... some options
plugins: [
{
module: 'bs-auth',
options: {
user: 'user',
pass: 'password'
}
}
]
}, () => {
bs.getOption('bsAuth'); // get plugin current options
});
```Browsersync [plugins configure](https://browsersync.io/docs/options#option-plugins)
## Default plugin options
```javascript
generatePassword: {
length: 7,
numbers: true
},
user: 'browsersync',
pass: false, // if not set or false, plugin generate random password
use: true
```
`generatePassword` options from [generate-password](https://www.npmjs.com/package/generate-password)