# chromex-pocket

> chrome extension pocket

Latest version **1.0.2** (published 2019-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install chromex-pocket
pnpm add chromex-pocket
yarn add chromex-pocket
bun add chromex-pocket
```

## 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.2 |
| Published | 2019-03-22 |
| First published | 2019-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ljun20160606 |
| Maintainers | ljun20160606 |
| Keywords | chrome, extension |

## Links

- npm: https://www.npmjs.com/package/chromex-pocket
- Repository: https://github.com/ljun20160606/chromex-pocket
- Homepage: https://github.com/ljun20160606/chromex-pocket#readme
- Issues: https://github.com/ljun20160606/chromex-pocket/issues
- npm.io page: https://npm.io/package/chromex-pocket

## Recent versions

- 1.0.2 (latest) — 2019-03-22
- 1.0.1 — 2019-03-22
- 1.0.0 — 2019-03-22

## README

# Chromex-pocket &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ljun20160606/chromex-pocket/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/ljun20160606/chromex-pocket/pull/new)

Chrome extension pocket.

## Installation

```
$ npm i chromex-pocket
```

### Router

Replace chrome.runtime.onMessage

On content page.

```js
const FOO = '/foo';
chrome.runtime.sendMessage({
      path: FOO,
      name: 'foo',
      gender: 'male'
    }, function (response) {

    }
);
```

On Background.

```js
let router = new Router()
router.handle(FOO, ctx => {
    return new Promise((resolve) => {
        let {name, gender} = ctx.request;

        ctx.response = {
            code: 0,
            data: 'ok'
        };
        resolve();
    };
});
```

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