mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 03:29:15 +00:00
generate json file
This commit is contained in:
33
packages/cli/configuration/index.js
Normal file
33
packages/cli/configuration/index.js
Normal 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 }
|
||||
Reference in New Issue
Block a user