# Installation

**Deep Waters** is released under the [MIT license](https://raw.githubusercontent.com/antonioru/deep-waters/master/LICENSE) & supports modern environments.

You can install it by using **NPM**:

```bash
npm install deep-waters
```

**Deep Waters** exports its modules as [CommonJS](https://en.wikipedia.org/wiki/CommonJS) modules, so that each one can be easily imported individually, as the following:

```javascript
const compose = require('deep-waters/compose');
const minLength = require('deep-waters/minLength');
const ofUniqueItems = require('deep-waters/ofUniqueItems'); 

const arrayValidator = compose(minLength(3), ofUniqueItems);  

arrayValidator([1,2,3,4]); // => true;
```

Alternatively, it's possible to import all the modules at once with the same result.

```javascript
const DW = require('deep-waters');

const arrayValidator = DW.compose(DW.minLength(3), DW.ofUniqueItems);  

arrayValidator([1,2,3,4]); // => true;
```

### UMD/AMD modules

The node package contains both an UMD and an AMD version of the module:&#x20;

```javascript
const DWumd = require('deep-waters/deep-waters.umd');

// or

const DWamd = require('deep-waters/deep-waters.amd');
```
