I\'m working with firebase functions and arrived to hundreds of functions, and now it is very hard to manage it in single index.js
file as shown in their lots of ex
//index.js
const glob = require('glob')
const files = glob.sync('./**/*.functions.js', { cwd: __dirname,
ignore: './node_modules/**' })
files.forEach(file => {
const functionModule = require(file)
const functionNames = Object.keys(functionModule)
functionNames.forEach(functionName => {
if (!process.env.FUNCTION_NAME || process.env.FUNCTION_NAME ===
functionName) {
exports[functionName] = functionModule[functionName]
}
})
})
Folders like so.. will work
//Example Home.functions.js :
exports.Home = functions.https..