# express-authjs

> Simple authentication middleware for expressjs using JSON Web Tokens.

Latest version **1.0.2** (published 2018-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-authjs
pnpm add express-authjs
yarn add express-authjs
bun add express-authjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-05-26 |
| First published | 2018-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | nerderbur |
| Keywords | express-authjs, express, authentication, auth, middleware, simple |

## Links

- npm: https://www.npmjs.com/package/express-authjs
- Repository: https://github.com/nerderbur/express-authjs
- Homepage: https://github.com/nerderbur/express-authjs#readme
- Issues: https://github.com/nerderbur/express-authjs/issues
- npm.io page: https://npm.io/package/express-authjs

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^3.1.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.2.1

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-05-26
- 1.0.0 — 2018-05-24
- 0.0.7 — 2018-05-24
- 0.0.6 — 2018-05-24
- 0.0.5 — 2018-05-24
- 0.0.4 — 2018-05-24
- 0.0.3 — 2018-05-24
- 0.0.2 — 2018-05-24
- 0.0.1 — 2018-05-24

## README

# Express Auth Middleware
express-authjs is a simple to use express middleware that adds configurable authentication to your express API routes with as little affort as possible.

## Table of Contents
- [Installation](#installing)
- [Basic Usage](#basic-usage)
- [Documentation](#documentation)
- [Changelog](#changelog)
- [License](#license)

## Getting Started
The instructions below will help you get started using exress-authjs as quickly as possible.

### Installing
```
npm install express-authjs
```

### Basic Usage
```javascript
const express = require('express');
const { Authenticator, guard } = require('express-authjs');

const authenticator = new Authenticator();

app.get('/', (req, res) => {
    res.send('Unprotected route.');
})

app.get('/protected', guard(authenticator), (req, res) => {
    res.send('Protected route.');
})
```

## Documentation
Please refer to the documentation website on https://nerderbur.github.io/express-authjs

## Changelog
Check the [Github Releases page](https://github.com/nerderbur/express-authjs/releases)

## License
MIT License

---
_Source: https://npm.io/package/express-authjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
