onmyjs

2.0.2 • Public • Published

onmyjs

turn your js config file into json

onmyjs(data: object, outputFilename?: string, pretty = true): void

  • data: the data to write
  • outputPath?: the relative file path/name to write to (.json ending if empty)
  • pretty: whether to pretty-print or not

Sample Usage

const { onmyjs } = require('onmyjs');
module.exports = {
  compilerOptions: {
    ...
  }
}
onmyjs(module.exports, undefined, true); // export to samename.json
onmyjs(module.exports, '../config/stuff.json', true); // export to relative path

Package Sidebar

Install

npm i onmyjs

Weekly Downloads

4

Version

2.0.2

License

MIT

Unpacked Size

3.18 kB

Total Files

6

Last publish

Collaborators

  • zachbryant