# swiftflow

> Maintainable expressjs endpoints.

Latest version **1.1.4** (published 2019-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install swiftflow
pnpm add swiftflow
yarn add swiftflow
bun add swiftflow
```

## 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.1.4 |
| Published | 2019-06-12 |
| First published | 2019-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rekkyrek |
| Maintainers | rekkyrek |
| Keywords | ExpressJS, Mobooru |

## Links

- npm: https://www.npmjs.com/package/swiftflow
- Repository: https://github.com/mobooru/swiftflow
- Homepage: https://github.com/mobooru/swiftflow#readme
- Issues: https://github.com/mobooru/swiftflow/issues
- npm.io page: https://npm.io/package/swiftflow

## Recent versions

- 1.1.4 (latest) — 2019-06-12
- 1.1.3 — 2019-04-15
- 1.1.2 — 2019-04-15
- 1.1.1 — 2019-04-14
- 1.1.0 — 2019-04-14
- 1.0.0 — 2019-01-23

## README

# SwiftFlow
Maintainable expressjs endpoints.
___
## Install
```
npm i --save swiftflow
```

## Example

```js
// server.js
const app = require("express")()
const { EndpointManager } = require("swiftflow")

// Create a new EndpointManager, points to a directory of JS files.
const endpoints = new EndpointManager("./endpoints")

// Install all JS files in "./endpoints" then listen on port 80.
endpoints.install(app).then(() => app.listen(80))
```

```js
// endpoints/hello.js
const { Endpoint } = require('swiftflow')

// Export a class that extends from the SwiftFlow Endpoint class.
module.exports = class HelloEndpoint extends Endpoint {
  constructor () {
    super('/api/hello/:name') // The path this endpoint will listen to.
  }

  async execute (params) {
    // All variables like .params and .query gets combined into a single object, "params".
    const { name } = params
    
    // The Endpoint class automatically handles returns and sends it to the client.
    return { response: `Hi there ${name}!` }
  }
}
```

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