An open API service indexing awesome lists of open source software.

https://github.com/krakenjs/shush

A simple module for reading JSON files that may have comments.
https://github.com/krakenjs/shush

Last synced: about 2 months ago
JSON representation

A simple module for reading JSON files that may have comments.

Awesome Lists containing this project

README

        

##### shush
Hush up those JSON comments.

`shush` is a simple node module that allows JSON files containing comments to be read into
a module using a `require`-like syntax.

```json
/* jsonWithComments.js */
{
// a property
"myProp": "isCool"
}
```
```javascript
// foo.js
var shush = require('shush'),
config = shush('./jsonWithComments');

console.log(config); // {"myProp": "isCool"}
```

```javascript
// foo.js es6 modules
import shush from 'shush';
const config = shush('./jsonWithComments.json');

console.log(config); // {"myProp": "isCool"}
```

Forthcoming feature: streaming.