# nodejs-tape

> express-based nodejs library

Latest version **2.5.0** (published 2019-10-25) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install nodejs-tape
pnpm add nodejs-tape
yarn add nodejs-tape
bun add nodejs-tape
```

## 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 | 2.5.0 |
| Published | 2019-10-25 |
| First published | 2018-11-14 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 16 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 (+15 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | liangmayong |
| Maintainers | liangmayong |
| Keywords | nodejs-tape |

## Links

- npm: https://www.npmjs.com/package/nodejs-tape
- Repository: https://github.com/whoopschat/nodejs-tape
- Homepage: https://github.com/whoopschat/nodejs-tape#readme
- Issues: https://github.com/whoopschat/nodejs-tape/issues
- npm.io page: https://npm.io/package/nodejs-tape

## Dependencies (16)

- [ect](https://npm.io/package/ect.md) ^0.5.9
- [cors](https://npm.io/package/cors.md) 2.8.5
- [helmet](https://npm.io/package/helmet.md) ^1.1.0
- [moment](https://npm.io/package/moment.md) ^2.11.2
- [morgan](https://npm.io/package/morgan.md) ^1.7.0
- [multer](https://npm.io/package/multer.md) ^1.4.1
- [express](https://npm.io/package/express.md) ^4.13.4
- [winston](https://npm.io/package/winston.md) ^3.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.0
- [compression](https://npm.io/package/compression.md) 1.7.4
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.4.0
- [connect-flash](https://npm.io/package/connect-flash.md) ^0.1.1
- [serve-favicon](https://npm.io/package/serve-favicon.md) ^2.3.0
- [body-parser-xml](https://npm.io/package/body-parser-xml.md) ^1.1.0
- [winston-daily-rotate-file](https://npm.io/package/winston-daily-rotate-file.md) ^3.3.0

## Recent versions

- 2.5.0 (latest) — 2019-10-25
- 2.4.0 — 2019-10-14
- 2.2.0 — 2019-07-10
- 2.1.0 — 2019-06-28
- 2.0.3 — 2019-03-05
- 2.0.2 — 2019-02-20
- 1.6.0 — 2019-01-03
- 0.0.4 — 2018-11-15
- 0.0.2 — 2018-11-14
- 0.0.1 — 2018-11-14

## README

# nodejs-tape
> express-based nodejs library

#### Install
```
> npm install nodejs-tape --save-dev
```

#### Usage
start
```js
// app.js
const Tape = require('nodejs-tape');
Tape.start({
    root: __dirname,
    name: "nodejs-tape",
    port: 3000,
    logs: "./logs",
    views: "./views",
    upload: "./assets/upload",
    storage: "./assets/storage",
    tokenSecretKey: "token-secret-key",
    static: [
        "./public",
        "./bower_components",
        "./assets"
    ],
    routes: [
        "./routes"
    ],
    beforeRoute: [
        function (req, res, next) {
            return next();
        }
    ],
    afterRoute: [
        function (err, req, res, next) {
            let _Error = {
                code: err.code || err.status || 500,
                msg: err.msg || err.toString(),
            }
            if (!_Error.code) {
                _Error.code = 500;
                _Error.msg = 'Server Error';
            }
            res.json(_Error);
        }
    ]
})
```
router
```js
// routes/index.js
'use strict';
const Tape = require('nodejs-tape');

exports.routes = {
  '/': { get: 'index' },
  '/upload': { post: Tape.createUploadRoute() },
}

exports.index = function (req, res, next) {
  res.send('hello world <br> server root : ' + Tape.getConfig().root);
}
```

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