How to use the readJsonAsync function from fs-extra
Find comprehensive JavaScript fs-extra.readJsonAsync code examples handpicked from public code repositorys.
GitHub: opencollective/wiki
68 69 70 71 72 73 74 75 76 77
* i18n */ () => { console.info(colors.white(' └── ') + colors.green('Copying i18n client files...')) return fs.ensureDirAsync('./assets/js/i18n').then(() => { return fs.readJsonAsync('./server/locales/en/browser.json').then(enContent => { return fs.readdirAsync('./server/locales').then(langs => { return Promise.map(langs, lang => { console.info(colors.white(' ' + lang + '.json')) let outputPath = path.join('./assets/js/i18n', lang + '.json')
0
1
4
+ 3 other calls in file
GitHub: opensavannah/wiki
73 74 75 76 77 78 79 80 81 82
return fs.readJsonAsync('./server/locales/en/browser.json').then(enContent => { return fs.readdirAsync('./server/locales').then(langs => { return Promise.map(langs, lang => { console.info(colors.white(' ' + lang + '.json')) let outputPath = path.join('./assets/js/i18n', lang + '.json') return fs.readJsonAsync(path.join('./server/locales', lang + '.json'), 'utf8').then((content) => { return fs.outputJsonAsync(outputPath, _.defaultsDeep(content, enContent)) }).catch(err => { // eslint-disable-line handle-callback-err return fs.outputJsonAsync(outputPath, enContent) })
0
0
2
+ 3 other calls in file
GitHub: robbynshaw/wiki
22 23 24 25 26 27 28 29 30 31
}) }).then(() => { /** * Fetch version from npm package */ return fs.readJsonAsync('package.json').then((packageObj) => { let versionGet = _.chain(packageObj.version).split('.').take(4).join('.') let remoteURL = _.replace('https://github.com/Requarks/wiki/releases/download/v{0}/wiki-js.tar.gz', '{0}', versionGet) return new Promise((resolve, reject) => {
0
0
2
fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)