UNPKG

jmdict-util

Version:

Parse JMdict XML file and export to SQLite and JSON files.

19 lines (16 loc) 349 B
const fs = require('fs'); /** * @param {Object} object * @param {string} path * @param {boolean} beautify */ function objectToJson(object, path, beautify = true) { /** @type {number} */ const space = beautify ? 2 : 0; fs.writeFileSync( path, JSON.stringify(object, null, space), 'utf8', ); } module.exports = objectToJson;