hjson-dsf-regex
Version:
Regular expression DSF for hjson-js
16 lines (12 loc) • 454 B
Markdown
# HJSON Regex DSF
Parse slash-delimited regexes in HJSON as RegExp
[](https://travis-ci.org/kba/hjson-dsf-regex)
## Usage
```js
const util = require('util')
const hjson = require('hjson')
const regexDsf = require('hjson-dsf-regex')
const data = `myre: /^\\d+/`
const parsed = hjson.parse(data, {dsf:[regexDsf()]})
console.log(util.inspect(parsed)) // -> { myre: /^\d+/ }
```