UNPKG

424 BPlain TextView Raw
1#!/usr/bin/env node
2
3import * as crypto from 'crypto'
4import * as yargs from 'yargs'
5import { dimGrey } from '../colors'
6import { runScript } from '../script'
7
8runScript(() => {
9 const { sizeBytes } = yargs.option('sizeBytes', {
10 type: 'number',
11 default: 256,
12 }).argv
13
14 const key = crypto.randomBytes(sizeBytes).toString('base64')
15
16 console.log(dimGrey('\nSECRET_ENCRYPTION_KEY:\n'))
17 console.log(key, '\n')
18})