# remi-topmarks-results

> A remi extension that adds the addResults method to the target.

Latest version **1.0.5** (published 2016-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install remi-topmarks-results
pnpm add remi-topmarks-results
yarn add remi-topmarks-results
bun add remi-topmarks-results
```

## 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.5 |
| Published | 2016-07-29 |
| First published | 2016-07-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Garth Braithwaite |
| Maintainers | garthdb |
| Keywords | remi, remi-extension, topmarks |

## Links

- npm: https://www.npmjs.com/package/remi-topmarks-results
- Repository: https://github.com/Topmarks/remi-topmarks-results
- Homepage: https://github.com/Topmarks/remi-topmarks-results#readme
- Issues: https://github.com/Topmarks/remi-topmarks-results/issues
- npm.io page: https://npm.io/package/remi-topmarks-results

## Dependencies (1)

- [camelcase](https://npm.io/package/camelcase.md) ^3.0.0

## Recent versions

- 1.0.5 (latest) — 2016-07-29
- 1.0.4 — 2016-07-29
- 1.0.3 — 2016-07-29
- 1.0.2 — 2016-07-29
- 1.0.1 — 2016-07-29
- 1.0.0 — 2016-07-29
- 0.1.0 — 2016-07-29

## README

# Add Results Plugin

[![Build Status](https://travis-ci.org/Topmarks/remi-topmarks-results.svg?branch=master)](https://travis-ci.org/Topmarks/remi-topmarks-results) [![Code Climate](https://codeclimate.com/github/Topmarks/remi-topmarks-results/badges/gpa.svg)](https://codeclimate.com/github/Topmarks/remi-topmarks-results) [![Test Coverage](https://codeclimate.com/github/Topmarks/remi-topmarks-results/badges/coverage.svg)](https://codeclimate.com/github/Topmarks/remi-topmarks-results/coverage) [![Issue Count](https://codeclimate.com/github/Topmarks/remi-topmarks-results/badges/issue_count.svg)](https://codeclimate.com/github/Topmarks/remi-topmarks-results) [![Dependency Status](https://david-dm.org/topmarks/remi-topmarks-results.svg)](https://david-dm.org/topmarks/remi-topmarks-results) [![Inline docs](http://inch-ci.org/github/Topmarks/remi-topmarks-results.svg?branch=master)](http://inch-ci.org/github/Topmarks/remi-topmarks-results) [![npm version](https://badge.fury.io/js/remi-topmarks-results.svg)](https://badge.fury.io/js/remi-topmarks-results)

A [remi](https://github.com/remijs/remi) extension that adds the addResults method to the app so it can be used by plugins. Designed to specifically make it easier to make [Topmarks](https://github.com/topmarks/topmarks) plugins.

## Installation

```sh
npm i remi-topmarks-results
```

## Usage

Register the extension in the registration app.

```js
import remi from 'remi';
import remiExpose from 'remi-topmarks-results';

const app = {};
const registrator = remi(app);
registrator.hook(addResults());

registrator.register({register: require('sample-plugin')});
```

Then plugins can use the `addResults` method:

```js
let samplePlugin = (app, options next) => {
  // do some stuff and gather the results
  app.addResults('foo'); // There's an optional parameter for a timestamp, if none is specified it will default to now.
  next();
}

samplePlugin.attributes = {
  pkg: require('../package.json')
}
```

After the plugin has added results, they are accessible on as `app.results`. It is an array that will continue to push results when they are added.

When the plugin has `url` and/or `pageId` properties, they will be included in the results.

As sample result:

```js
[ { plugin: 'plugin', timestamp: 1469770823748, report: 'foo' } ]
```

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