# jasmine-matchers-loader

> An API to register Jasmine Matchers compatible with Jasmine v1 and v2.

[![npm downloads](https://img.shields.io/npm/dm/jasmine-matchers-loader.svg?style=flat-square)](https://www.npmjs.com/package/jasmine-matchers-loader)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/JamieMason/jasmine-matchers-loader.svg?style=social)](https://twitter.com/intent/tweet?text=An%20API%20to%20register%20Jasmine%20Matchers%20compatible%20with%20Jasmine%20v1%20and%20v2%20%23JavaScript%20%23NodeJS%20&url=https%3A%2F%2Fgithub.com%2FJamieMason%2Fjasmine-matchers-loader)
[![Follow @fold_left on Twitter](https://img.shields.io/twitter/follow/fold_left.svg?style=social)](https://twitter.com/fold_left)
[![GitHub stars](https://img.shields.io/github/stars/JamieMason/jasmine-matchers-loader.svg?style=social&label=Star)](https://github.com/JamieMason/jasmine-matchers-loader)
[![GitHub followers](https://img.shields.io/github/followers/JamieMason.svg?style=social&label=Follow)](https://github.com/JamieMason)

This project was previously part of the implementation of [Jasmine Matchers](https://github.com/JamieMason/Jasmine-Matchers) and has been taken out to help other people share their own Matchers.

## Usage

The [/src directory of Jasmine Matchers](https://github.com/JamieMason/Jasmine-Matchers/tree/master/src) serves as an example of a many different types of matcher functions using this loader.

### CommonJS

```javascript
var jasmineMatchers = require('jasmine-matchers-loader');

jasmineMatchers.add({
    toBeJustAnExample: function(actual) {
        return actual === 'Just an example';
    }
});
```

### Browser

```html
<script src="dist/jasmine-matchers-loader.js"></script>
<script>
    window.jasmineMatchers.add({
        toBeJustAnExample: function(actual) {
            return actual === 'Just an example';
        }
    });
</script>
```
