UNPKG

@dotenvx/dotenvx-radar

Version:
25 lines (20 loc) 610 B
const { logger } = require('@dotenvx/dotenvx') const Session = require('./../../../db/session') const smartMask = require('./../../../lib/helpers/smartMask') function token () { const options = this.opts() try { const sesh = new Session() const token = sesh.token() if (token && token.length > 1) { process.stdout.write(smartMask(token, options.unmask, 11)) } else { logger.error('missing token. Try generating one with [dotenvx-radar login].') process.exit(1) } } catch (error) { logger.error(error.message) process.exit(1) } } module.exports = token