dotenvx.get(KEY, {mask: true})

Programmatically return a masked environment variable value.

By default, up to the first six characters are visible.

// index.js
const dotenvx = require('@dotenvx/dotenvx')

async function main() {
  const maskedValue = await dotenvx.get('SECRET', { mask: true })

  console.log(maskedValue)
}

main()
$ node index.js
abcdef******

Set mask: 0 to fully mask values.