Files
my_site/node_modules/@dotenvx/dotenvx/src/lib/helpers/prependPublicKey.js
2026-03-24 14:30:59 +08:00

18 lines
609 B
JavaScript

function prependPublicKey (publicKeyName, publicKey, filename, relativeFilepath = '.env.keys') {
const comment = relativeFilepath === '.env.keys'
? ''
: ` # -fk ${relativeFilepath}`
return [
'#/-------------------[DOTENV_PUBLIC_KEY]--------------------/',
'#/ public-key encryption for .env files /',
'#/ [how it works](https://dotenvx.com/encryption) /',
'#/----------------------------------------------------------/',
`${publicKeyName}="${publicKey}"${comment}`,
'',
`# ${filename}`
].join('\n')
}
module.exports = prependPublicKey