# abox

> [![Build Status](https://travis-ci.org/no0dles/abox.svg?branch=master)](https://travis-ci.org/no0dles/abox) [![npm version](https://badge.fury.io/js/abox.svg)](https://badge.fury.io/js/abox) [![codecov.io](http://codecov.io/github/no0dles/abox/coverage.sv

Latest version **1.0.2** (published 2016-10-04) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-10-04 |
| First published | 2016-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | no0dles |
| Maintainers | no0dles |
| Keywords | api, toolbox |

## Links

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

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) ^5.0.0-beta.12
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.8

## Recent versions

- 1.0.2 (latest) — 2016-10-04
- 1.0.1 — 2016-10-02

## README

# abox - Api Toolbox
[![Build Status](https://travis-ci.org/no0dles/abox.svg?branch=master)](https://travis-ci.org/no0dles/abox)
[![npm version](https://badge.fury.io/js/abox.svg)](https://badge.fury.io/js/abox)
[![codecov.io](http://codecov.io/github/no0dles/abox/coverage.svg?branch=master)](http://codecov.io/github/no0dles/abox?branch=master)

## Quickstart

### Installation
```
npm install abox --save
```

### Code Example
action.ts
```typescript
import {Action} from "abox";

@Action({ name: "ping" })
export class Ping {
  constructor(public message: string) {

  }
}

@Action({ name: "pong" })
export class Pong {
  constructor(public message: string) {

  }
}
```

app.ts
```typescript
import {Api} from "abox";
import {Ping, Pong} from "./actions";

const api = new Api();

api
  .on(Ping)
  .handle((context, data) => {
    context.done(new Pong(data.message));
  });

api
  .on(Pong)
  .handle((context, data) => {
    console.log("Pong:", data.message);
    context.done();
  });

export = api;
```

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