Created
November 26, 2018 20:32
-
-
Save gerrard00/a20b8f6a825330ea9f2f24ab3c465d91 to your computer and use it in GitHub Desktop.
Convert a json object to a node module...don't ask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const util = require('util'); | |
const contents = fs.readFileSync(0, 'utf8'); | |
const jsonObject = JSON.parse(contents); | |
const javascriptString = util.inspect(jsonObject, { depth: null }); | |
console.log(` | |
'use strict'; | |
module.exports = | |
${javascriptString} | |
; | |
`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Invoke with prettier: