# endpoints-model

> model layer for the endpoints framework.

Latest version **0.1.2** (published 2014-06-23) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install endpoints-model
pnpm add endpoints-model
yarn add endpoints-model
bun add endpoints-model
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-06-23 |
| First published | 2014-06-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | Tyler Kellen |
| Maintainers | tkellen |
| Keywords | rest api |

## Links

- npm: https://www.npmjs.com/package/endpoints-model
- Repository: https://github.com/endpoints/model
- Issues: https://github.com/endpoints/model/issues
- npm.io page: https://npm.io/package/endpoints-model

## Dependencies (2)

- [when](https://npm.io/package/when.md) ^3.2.3
- [lodash](https://npm.io/package/lodash.md) ^2.4.1

## Recent versions

- 0.1.2 (latest) — 2014-06-23
- 0.1.1 — 2014-06-20
- 0.1.0 — 2014-06-20

## README

# endpoints-model [![Build Status](https://secure.travis-ci.org/endpoints/model.png)](http://travis-ci.org/endpoints/model)
> model layer for the endpoints framework

[![NPM](https://nodei.co/npm/endpoints-model.png)](https://nodei.co/npm/endpoints-model/)

a quick and dirty extraction of some tools i use all the time for building rest apis.

## Example
```js
const Model = require('endpoints-model');
const Knex = require('knex')({
  client: "pg",
  connection: {
    host: "localhost",
    user: "user",
    database: "db",
    password: "pass"
  },
});
const BaseModel = Model({
  Bookshelf: require('bookshelf')(Knex),
  Validator: require('checkit'),
  linkPrefix: '/api/v1' // when a model is serialized, the automatically generated `links` key may need a prefix to produce the correct endpoint URL.
});
```

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