JohnPostlethwait/stringify — pull request #5 by livoras (2014-05-01 04:41:53+00:00)
Title: Add `through` devDependencies & fix `extensions` doesn't work as documentation says

Hi, there. I really like your work and it does help!

I update the source code and I hope the works I did would make it better.

Here are the marjor updates of this PR:

### 1. add `through` dependency to `package.json`

The `index.js` depends on `through`, but it doesn't apparent in `package.json`. This will cause an error of module is not found while runtime.

### 2. options of `stringify` function doesn't work as documentation says

According to the [docs](https://github.com/JohnPostlethwait/stringify#usage), code below will with the `.hbs` extension.

```javascript
var browserify = require('browserify'),
stringify = require('stringify');

var bundle = browserify()
.transform(stringify(['.hbs', '.handlebars']))
.addEntry('my_app_main.js');

app.use(bundle);
```

But the `index.js` code indicates that the `stringify` function accepts actually an object `options` containing `extensions` instead of merely an array. I update `index.js` to make it work with two kind of options:

```
// with object
var bundle = browserify()
.transform(stringify({
extensions: ['.hbs', '.handlebars']
})).addEntry('my_app_main.js');

// with array
var bundle = browserify()
.transform(stringify(['.hbs', '.handlebars']))
.addEntry('my_app_main.js');
```

PS: Adding tests would be reliable.

Hope it helps.