How to use the outputJson function from fs-extra
Find comprehensive JavaScript fs-extra.outputJson code examples handpicked from public code repositorys.
GitHub: MarkBind/markbind
438 439 440 441 442 443 444 445 446 447
* Helper function for addDefaultLayoutToSiteConfig(). */ static async writeToSiteConfig(config, configPath) { const layoutObj = { glob: '**/*.md', layout: LAYOUT_DEFAULT_NAME }; config.pages.push(layoutObj); await fs.outputJson(configPath, config); } static printBaseUrlMessage() { logger.info('The default base URL of your site is set to /\n'
106
94
13
+ 3 other calls in file
GitHub: dacsang97/huncwot
26 27 28 29 30 31 32 33 34
console.log(`Initialising '${dir}'...`); console.log(`Database engine: '${dbengine}'`); // dynamic files const databaseConfig = join(cwd, dir, 'config', 'database.json'); await fs.outputJson(databaseConfig, generateDatabaseConfig(name), { spaces: 2 }); const packageJSON = join(cwd, dir, 'package.json'); await fs.outputJson(packageJSON, generatePackageJSON(dir, dbengine), { spaces: 2 });
36
0
2
+ 3 other calls in file
174 175 176 177 178 179 180 181 182
return } // save updated cache to filesystem cache[src] = dimensions return fse.outputJson(config.files.imageCache, cache) }) .then(() => { addingImgToCache = false
1
16
9
GitHub: gaojianstyle/daimazun
15 16 17 18 19 20 21 22 23 24
try { const fs = require('fs-extra'); let file = this.json_file_src; fs.remove(file).then(() => { // 创建json并写入初始化json数据 fs.outputJson(file, {...init_json}).then(r => { resolve(true) }) }) } catch (e) {
0
1
1
+ 1109 other calls in file
GitHub: jzwood/meowvc
42 43 44 45 46 47 48 49 50 51
print(chalk.yellow('Warning: no changes detected. Save cancelled.')) } else { await _writeToDisk() const [head, version] = [po.head, po.version] await mod.metaOps.update(head, version, mdata) await fs.outputJson(mod.muOps.path('history', head, 'v' + version + '.json'), diff.currentTree) await po.incrementVersion() print(chalk.green(`${head} v${version} successfully saved!`)) } }
0
1
0
248 249 250 251 252 253 254 255 256 257 258 259
]; var fallbackVersion = { minor: '9201', symbol: 'Uo', element: 'Unobtainium' }; async function run() { outputJson(OUTPUT_PATH, await getReleases(), { spaces: 2 }); } run();
0
0
1
+ 15 other calls in file
GitHub: saby/builder
268 269 270 271 272 273 274
/** * write critical initialize error into a single file. workerpool has a problem with emit * of this errors - all of this errors emits with message "Worker terminated unexpectedly" * without any message about what's exactly happened inside worker that cause process exit. */ fs.outputJson(path.join(process.env.logsPath, `worker/worker-initialize-error-${process.pid}.json`), error); }
0
0
0
+ 3 other calls in file
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)