generate json file

This commit is contained in:
Leifer
2022-10-27 11:10:04 +02:00
parent ceade85334
commit 860bd8539f
8 changed files with 109 additions and 18 deletions

View File

@@ -0,0 +1,33 @@
const { writeFile } = require('fs').promises
const { join } = require('path')
/**
* JSON_TEMPLATE = {[key:string]{...pros}}
*/
const JSON_TEMPLATE = {
provider: {
vendor: '',
},
database: {
host: '',
password: '',
port: '',
username: '',
db: '',
},
io: {
vendor: '',
},
}
const PATH_CONFIG = join(process.cwd(), 'config.json')
const jsonConfig = () => {
return writeFile(
PATH_CONFIG,
JSON.stringify(JSON_TEMPLATE, null, 2),
'utf-8'
)
}
module.exports = { jsonConfig }