<commit_before>[![Build Status](https://travis-ci.org/admittedly/express-sequelize-params.svg?branch=master)](https://travis-ci.org/admittedly/express-sequelize-params)

express-sequelize-params
========================

Express middleware for populating params with sequelize objects.

Installation
---
```
npm install express-sequelize-params
```

Basic usage
---
```
var app = express();
var esp = require("express-sequelize-params");
app.param(":my_model", esp(self.models.MyModel));
```

Running tests
---
Tests assume that you have a test mysql database accessible without password.
```
echo 'CREATE DATABASE express_sequelize_params_test;' | mysql -uroot
```
<commit_msg>Readme update<commit_after>[![Build Status](https://travis-ci.org/admittedly/express-sequelize-params.svg?branch=master)](https://travis-ci.org/admittedly/express-sequelize-params)

express-sequelize-params
========================

Express middleware for populating params with sequelize objects.

Installation
---
```
npm install express-sequelize-params
```

Basic usage
---
This middleware will replace a given param with the corresponding instance of the given model.
```
var app = express();
var MyModel = sequelize.define("MyModel");
var esp = require("express-sequelize-params");
app.param(":my_model", esp(MyModel));
```
You can specify the parameter to replace with an option
```
app.param(":myModel", esp(MyModel, {parameterName: "myModel"}));
```

Running tests
---
Tests assume that you have a test mysql database accessible without password.
```
echo 'CREATE DATABASE express_sequelize_params_test;' | mysql -uroot
```

{'fraction_non_alphanumeric': 0.16511483550589695, 'fraction_numerical': 0.0, 'mean_word_length': 5.716666666666667, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '4679108', 'n_tokens_mistral': 499, 'n_tokens_neox': 475, 'n_words': 123}