<commit_before># Directions

> Build an application that highlights directions (east, north, south, west) and distances (miles, kilometers, feet, etc.) inside a text body.

From [Tim Caswell's Play by Play session][pbp].

## Getting started

In order to get hacking into `Directions` you'll need:

- [Node.js][node]
- [CoffeeScript][coffee]
- A descent browser.

### Setting things up

Once you have Node.js installed and NPM (which is when you install Node) then run:

```bash
npm install -g coffee-script
```

And you're done. :)

### Running the application

As simple as running `coffee app.coffee`.

You can run the application on a different port by running `PORT=8000 coffee app.coffee`.

**Pro-Tip**: 
Want to restart your server each time code changes? Use `nodemon`! 
Install it with `npm install -g nodemon`, then do `nodemon app.coffee`.

## Lessons learned

Here are some take-aways from my experience building this little side-project.

- Vanilla Node.js is both daunting and **exciting**.
- Always keep JavaScript docs at hand.

[pbp]: http://beta.pluralsight.com/courses/play-by-play-tim-caswell
[node]: http://nodejs.org/download/
[coffee]: http://coffeescript.org/<commit_msg>Update documentation.<commit_after># Directions

> Build an application that highlights directions (east, north, south, west) and distances (miles, kilometers, feet, etc.) inside a text body.

From [Tim Caswell's Play by Play session][pbp].

## Install

```bash
$ npm install https://github.com/francisbrito/directions
```

## Usage

```javascript
var directions = require('directions');

var matches = directions.findMatchesIn('Head 5 meters north, then 10 meters east.');
```

## API

### directions.findMatchesIn(text)

Finds strings matching cardinal directions (north, west, east, south) and distances in `text`.

#### text
**Required**

Type: `string`

An arbitrary string.

#### returns

An array containing all matches.

[pbp]: http://beta.pluralsight.com/courses/play-by-play-tim-caswell
{'fraction_non_alphanumeric': 0.12311557788944724, 'fraction_numerical': 0.0035175879396984926, 'mean_word_length': 4.545961002785515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '271593', 'n_tokens_mistral': 631, 'n_tokens_neox': 592, 'n_words': 228}