<commit_before>command-mapper-validator
========================

[![Build Status](https://travis-ci.org/RickEyre/command-mapper-validator.svg?branch=master)](https://travis-ci.org/RickEyre/command-mapper-validator) [![npm-version](http://img.shields.io/npm/v/command-mapper-validator.svg)](https://www.npmjs.org/package/command-mapper-validator) [![Dependency Status](https://david-dm.org/RickEyre/command-mapper-validator.svg?theme=shields.io)](https://david-dm.org/RickEyre/command-mapper-validator) [![devDependency Status](https://david-dm.org/RickEyre/command-mapper-validator/dev-status.svg?theme=shields.io)](https://david-dm.org/RickEyre/command-mapper-validator#info=devDependencies)

Validates mapping objects or mapping JSON files. For more information see
[command-mapper](https://github.com/RickEyre/command-mapper).
<commit_msg>Update README with install and usage sections.<commit_after>command-mapper-validator
========================

[![Build Status](https://travis-ci.org/RickEyre/command-mapper-validator.svg?branch=master)](https://travis-ci.org/RickEyre/command-mapper-validator) [![npm-version](http://img.shields.io/npm/v/command-mapper-validator.svg)](https://www.npmjs.org/package/command-mapper-validator) [![Dependency Status](https://david-dm.org/RickEyre/command-mapper-validator.svg?theme=shields.io)](https://david-dm.org/RickEyre/command-mapper-validator) [![devDependency Status](https://david-dm.org/RickEyre/command-mapper-validator/dev-status.svg?theme=shields.io)](https://david-dm.org/RickEyre/command-mapper-validator#info=devDependencies)

Validates mapping objects or mapping JSON files. For more information see
[command-mapper](https://github.com/RickEyre/command-mapper).

Install
=======

```bash
$ npm install command-mapper-validator
```

Usage
=====

The module exports a single function that validates mapping option objects. It
returns an array of errors, if any.

```js
var validate = require("command-mapper-validator"),
    mappings = require("my-mapping.json");

validate(mappings).forEach(function(error) {
  console.log(error);
});
```

{'fraction_non_alphanumeric': 0.19045346062052507, 'fraction_numerical': 0.0, 'mean_word_length': 6.277777777777778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5053674', 'n_tokens_mistral': 718, 'n_tokens_neox': 693, 'n_words': 79}