# mattermark

> A node module that wraps the Mattermark API.

Latest version **0.0.2** (published 2015-12-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-12-13 |
| First published | 2015-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Chris Dzoba |
| Maintainers | dzoba |
| Keywords | Mattermark |

## Links

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

## Dependencies (11)

- [chai](https://npm.io/package/chai.md) ^3.4.1
- [gulp](https://npm.io/package/gulp.md) ^3.9.0
- [mocha](https://npm.io/package/mocha.md) ^2.3.4
- [yargs](https://npm.io/package/yargs.md) ^3.31.0
- [request](https://npm.io/package/request.md) ^2.67.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.0.6
- [gulp-exit](https://npm.io/package/gulp-exit.md) 0.0.2
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [gulp-mocha](https://npm.io/package/gulp-mocha.md) ^2.2.0
- [gulp-eslint](https://npm.io/package/gulp-eslint.md) ^1.1.1
- [gulp-load-plugins](https://npm.io/package/gulp-load-plugins.md) ^1.1.0

## Recent versions

- 0.0.2 (latest) — 2015-12-13
- 0.0.1 — 2015-12-13

## README

# mattermark api wrapper

[downloads-image]: http://img.shields.io/npm/dm/mattermark.svg
[npm-url]: https://npmjs.org/package/mattermark
[npm-image]: https://badge.fury.io/js/mattermark.svg

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]  [![Build Status](https://travis-ci.org/dzoba/mattermark.svg?branch=master)](https://travis-ci.org/dzoba/mattermark) [![Dependency Status](https://gemnasium.com/dzoba/mattermark.svg)](https://gemnasium.com/dzoba/mattermark)


Node.js wrapper for the [Mattermark.com](http://mattermark.com) API. See full Mattermark API documentation [here](http://http://mattermark.com/api/).

## Table of Contents

- [Getting Started](#getting-started)
  - [Installation](#installation)
  - [Usage](#usage)
  - [Options](#options)
- [Examples](#examples)
- [Contributing](#contributing)
- [Testing](#testing)

## Getting Started

First, you will need to get API access from [Mattermark.com](http://mattermark.com/api/) in the form of an API Key.

### Installation

This library can be installed through npm:

```
$ npm install mattermark
```

To build and install from the latest source:

```
$ git clone git@github.com:dzoba/mattermark.git
$ npm install
```

### Usage
```javascript
var Mattermark = require('mattermark')('YOUR API KEY');

// change internal defaults (e.g. host)
var options = {/* see options below */};
var Mattermark = require('mattermark')('YOUR API KEY', options);

// you can also just pass options
var options = { apiKey: 'foo', host: 'bar' };
var Mattermark = require('mattermark')(options);

// callback pattern
Mattermark.companies.list(function (err, body) {
  if (err) return callback(err);
  return callback(null, body.data);
});
```

Additionally, every resource method returns a promise, so you don't have to use the regular callback. E.g.

```javascript
var Mattermark = require('mattermark')('YOUR API KEY');

Mattermark.companies.list()
.then(function (res) {
  console.log(res.data);
})
.catch(function (e) {
  console.log(e);
});
```

### Options
The Mattermark constructor accepts an `options` object which may contain one or more of the following options:

* `host` - Override the default host API calls are issued to.
* `userAgent` - Override the default userAgent.
* `headers` - Edit the headers sent in all API calls.

## Examples

Various examples for you to try out are here: [here](https://github.com/dzoba/mattermark/tree/master/examples).

## Contributing

Contributions are very welcome!  Please log issues using the Github issues interface.  Please submit code changes in the form of a pull request from your own branched version of the project.

## Testing

To run the tests you will need an API key.  This can be set in an environment variable named MM_API_KEY, or in a file called apikey in the root of this project.  Then run:

    npm run test
To lint the code (please lint before submitting a PR):

    npm run lint

=======================

Released under the MIT License, which can be found in the repository in `LICENSE.txt`.

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