<commit_before>Grapnel.js
==========

#### A Tiny JavaScript Router With Lots of Features—1.1kb gzipped!

# Features &amp; Basic Usage

## Router

```javascript
var router = new Grapnel();

router.get('products/:id?', function(req){
    var id = req.params.id;
    // GET http://mysite.com/#products/134
    console.log(id);
    // => 134
});
```

## Named Parameters
Grapnel.js supports regex style routes similar to Sinatra or Express. The properties are mapped to the parameters in the request.
```javascript
router.get('products/:id?', function(req){
    // GET /file.html#products/134
    req.params.id
    // => 134
});

router.get('products/*', function(req){
    // The wildcard/asterisk will match anything after that point in the URL
    // Parameters are provided req.params using req.params[n], where n is the nth capture
});
```

## Using Multiple Routes

```javascript
var routes = {
    'products' : function(req){
        // GET /file.html#products
    },
    'products/:category/:id?' : function(req){
        // GET /file.html#products/widgets/35
        req.params.category
        // => widgets
    }
}

Grapnel.listen(routes);<commit_msg>Minor text change<commit_after>Grapnel.js
==========

#### A Tiny JavaScript Router With Lots of Features—1.1kb gzipped!

# Features &amp; Basic Usage

## Router

```javascript
var router = new Grapnel();

router.get('products/:id?', function(req){
    var id = req.params.id;
    // GET http://mysite.com/#products/134
    console.log(id);
    // => 134
});
```

## Named Parameters
Grapnel.js supports regex style routes similar to Sinatra or Express. The properties are mapped to the parameters in the request.
```javascript
router.get('products/:id?', function(req){
    // GET /file.html#products/134
    req.params.id
    // => 134
});

router.get('products/*', function(req){
    // The wildcard/asterisk will match anything after that point in the URL
    // Parameters are provided req.params using req.params[n], where n is the nth capture
});
```

## Declaring Multiple Routes

```javascript
var routes = {
    'products' : function(req){
        // GET /file.html#products
    },
    'products/:category/:id?' : function(req){
        // GET /file.html#products/widgets/35
        req.params.category
        // => widgets
    }
}

Grapnel.listen(routes);
{'fraction_non_alphanumeric': 0.15563198624247634, 'fraction_numerical': 0.013757523645743766, 'mean_word_length': 3.11858407079646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '272776', 'n_tokens_mistral': 749, 'n_tokens_neox': 714, 'n_words': 201}