dotenv-next
TypeScript icon, indicating that this package has built-in type declarations

0.1.24 • Public • Published

dotenv-next

Load environment variables in your scripts following the priority specification popularized by Next.js.

This package is a thin wrapper around the internal @next/env package from Next.js. It adds an little register hook which allows your to register your environment variables at the top of script files.

#!/usr/bin/env node

import 'dotenv-next/register'

const main = async () => {
  await new Promise((resolve) =>
    setTimeout(() => {
      console.log(process.env.NODE_ENV)
    }, 1000),
  )
}

main()
  .catch((error) => {
    console.log(error)
    process.exit(1)
  })
  .finally(() => {
    process.exit(0)
  })

Readme

Keywords

none

Package Sidebar

Install

npm i dotenv-next

Weekly Downloads

2

Version

0.1.24

License

MIT

Unpacked Size

12.4 kB

Total Files

14

Last publish

Collaborators

  • tundera