Skip to content

Instantly share code, notes, and snippets.

Last active May 2, 2019
What would you like to do?
Fetch configurations from Firestore's collection "configurations" as json files.
process.env.NODE_ENV = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
.then(documents =>
documents.forEach((document) =>
require('fs').writeFile(`${require('../src/utils').baseDir}/config/${}.json`, JSON.stringify(, (error) =>
error ? console.error(error) : console.log(`Configuration file ${}.json has been created!`))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment