# standard-payload

> Tiny library for creating standard response payloads for Node.js based REST API's.

Latest version **1.0.0** (published 2017-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install standard-payload
pnpm add standard-payload
yarn add standard-payload
bun add standard-payload
```

## 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.0 |
| Published | 2017-11-24 |
| First published | 2017-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arthur Khlghatyan |
| Maintainers | arthurkhlghatyan |

## Links

- npm: https://www.npmjs.com/package/standard-payload
- Repository: https://github.com/arthurkhlghatyan/standard-payload
- Homepage: https://github.com/arthurkhlghatyan/standard-payload#readme
- Issues: https://github.com/arthurkhlghatyan/standard-payload/issues
- npm.io page: https://npm.io/package/standard-payload

## Recent versions

- 1.0.0 (latest) — 2017-11-24

## README

# standard-payload
Tiny library for creating standard response payloads for Node.js based REST API's.

# Installation
```bash
npm install --save standard-payload
```

# Usage
```js
const payload = require('standard-payload');

payload.withItem({
  id: 5,
  name: 'Arthur',
});

/**

Returns object.
{
  error: false,
  payload: {
    item: {
      id: 5,
      name: 'Arthur',
    }
  }
}

**/
```

# Api

- payload.withItem(obj) - Send item object.
- payload.withItems(array) - Send array of items with payload
- payload.withMessage(msgString) - Send message string in payload
- payload.withError(errorObj) - Send error item in payload

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