<commit_before># optionale

[![Build Status](https://travis-ci.org/javiercejudo/optionale.svg)](https://travis-ci.org/javiercejudo/optionale)
[![Coverage Status](https://coveralls.io/repos/javiercejudo/optionale/badge.svg?branch=master)](https://coveralls.io/r/javiercejudo/optionale?branch=master)
[![Code Climate](https://codeclimate.com/github/javiercejudo/optionale/badges/gpa.svg)](https://codeclimate.com/github/javiercejudo/optionale)

Minimal loader of optional packages

## Install

    npm i optionale

## Usage

```js
var optionale = require('optionale').optionale;

optionale('invalid-package'); // => undefined
optionale('util'); // => {…}
```

See [spec](test/spec.js).<commit_msg>docs(README): add usage examples for any and some<commit_after># optionale

[![Build Status](https://travis-ci.org/javiercejudo/optionale.svg)](https://travis-ci.org/javiercejudo/optionale)
[![Coverage Status](https://coveralls.io/repos/javiercejudo/optionale/badge.svg?branch=master)](https://coveralls.io/r/javiercejudo/optionale?branch=master)
[![Code Climate](https://codeclimate.com/github/javiercejudo/optionale/badges/gpa.svg)](https://codeclimate.com/github/javiercejudo/optionale)

Minimal loader of optional packages

## Install

    npm i optionale

## Usage

```js
var optionale = require('optionale');

optionale.optionale('invalid-package'); // => undefined
optionale.optionale('util'); // => {…}

optionale.any(['invalid-package', 'util']); // => {…}
optionale.any(['invalid-package', 'invalid-package2']); // => undefined

optionale.some(['invalid-package', 'util']); // => {…}
optionale.some(['invalid-package', 'invalid-package2']); // => throws Error
```

See [spec](test/spec.js).
{'fraction_non_alphanumeric': 0.19705014749262537, 'fraction_numerical': 0.0011799410029498525, 'mean_word_length': 5.894308943089431, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, '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': '7160940', 'n_tokens_mistral': 594, 'n_tokens_neox': 575, 'n_words': 75}