This file ( 1kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
const pkg = require('../package')
const fs = require('fs').promises
const path = require('path')
const chalk = require('chalk')
const parseConfig = async (opts) => {
const yaml = require('js-yaml')
//console.warn(opts)
const yamlString = (await fs.readFile(opts.config)).toString()
const yamlConfig = yaml.load(yamlString)
//console.warn(yamlConfig)
return yamlConfig
}
module.exports.defaults = async () => {
const { program } = require('commander')
//console.warn(options)
const configPath = path.dirname(program.opts().config)
const config = await parseConfig({
config: program.opts().config
})
const storagePath = path.resolve(configPath, config.storage)
const dbPath = path.resolve(storagePath, '.verdaccio-db.json');
const db = require(dbPath)
return {
configPath: configPath,
config: config,
storagePath: storagePath,
db: db,
dbPath: dbPath,
}
}
module.exports.confirmInfo = (options) => {
if (options.confirm !== true) {
console.info(chalk.yellow(`
Please add a flag --confirm and only add this flag after you stopped Verdaccio!
`))
}
}
module.exports.parseConfig = parseConfig
module.exports.pkg = pkg