# crest-client

> crest-client

Latest version **3.2.0** (published 2018-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install crest-client
pnpm add crest-client
yarn add crest-client
bun add crest-client
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2018-06-14 |
| First published | 2018-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.9 |
| Dependencies | 1 |
| Unpacked size | 110.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chrisjpalmer |

## Links

- npm: https://www.npmjs.com/package/crest-client
- Repository: https://github.com/chrisjpalmer/crest-client
- Homepage: https://github.com/chrisjpalmer/crest-client#readme
- Issues: https://github.com/chrisjpalmer/crest-client/issues
- npm.io page: https://npm.io/package/crest-client

## Dependencies (1)

- [rxjs](https://npm.io/package/rxjs.md) ^6.2.0

## Recent versions

- 3.2.0 (latest) — 2018-06-14
- 3.1.0 — 2018-06-11
- 3.0.0 — 2018-06-08
- 2.1.0 — 2018-06-08
- 2.0.0 — 2018-06-08
- 1.2.1 — 2018-06-04
- 1.1.1 — 2018-06-04
- 1.1.0 — 2018-06-04
- 1.0.0 — 2018-06-04

## README

# Crest Client
A starter for creating your own typescript client module for a *Crest Compliant Server*.

1. Update package.json => change the package name to a [private-scoped](https://docs.npmjs.com/private-modules/intro) module
2. Update package.json => change the git url
3. Get the packages: `npm install`
4. Build your client `npm run down path/to/crest/server`
5. Publish your client: `npm login`, `npm publish`

`down` will add the routes to the module.

Usage:
```bash
#In your client project:
npm login #Provide your user credentials.
npm install @myproject/crest-client --save
```

```ts
import { APIClient, MessageCategoryClass } from '@myproject/crest-client';

//TODO show how to implement this as APIService in an Angular project
//TODO provide clarification on httpMechansim and storageMechanism

let apiClient = new APIClient("http://localhost:3000", httpMechanism, storageMechanism);
let resultObservable<GetOutput<MessageCategoryClass.GetOutput>> = await apiClient.do('@/message/category', Method.GET, {

});
resultObservable.subscribe(messageCats => {
    messageCats.list.forEach(cat => {
        console.log(cat.name);
    });
    let idToFind = 10;
    console.log('this is the entire MessageCategoryClass.GetOutput which has id 10', messageCats.index[10]);
})


```

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