json-parse-with-protocol

JSON.parse with protocol like 'path:', 'file:'

Usage no npm install needed!

<script type="module">
  import jsonParseWithProtocol from 'https://cdn.skypack.dev/json-parse-with-protocol';
</script>

README

JSON.parse with protocol

It's instead of shortstop@async, sometimes we need read config file sync

Installation

npm install json-parse-with-protocol

Usage

var jsonpp = require('json-parse-with-protocol')

var jsonString = JSON.stringify({
    foo: 'bar',
    path: 'path:./your-path',
    file: 'file:/your-file'
})

console.log( jsonpp(jsonString) )
// -> { foo: bar, path: "/full path/your-path", file: <..file buffer..> }