Releases: adonisjs/env
Bug fix and remove dotenv dependency in favor of Node.js parseEnv util
7.0.0-next.3 (2025-12-15)
Bug Fixes
Features
- remove dotenv in favor of util.parseEnv 0a596e9
Full Changelog: v7.0.0-next.2...v7.0.0-next.3
Add secret schema type
Add file identifier
7.0.0-next.1 (2025-08-28)
Features
- add file identifier to read file contents (5dc2f6a)
- share appRoot with the parser to share it with identifier callbacks (71797a2)
Full Changelog: v7.0.0-next.0...v7.0.0-next.1
Update dependencies
7.0.0-next.0 (2025-08-15)
Full Changelog: v6.2.0...v7.0.0-next.0
Introduce defineIdentifier and defineIdentifierIfMissing methods
The Env.identifier method has been deprecated in favor of defineIdentifier and defineIdentifierIfMissing method is added to define the identifier only when its not already defined
6.2.0 (2025-03-19)
- test: small improvements to the test cases (f1e786b)
- test: update test to have assertions (459aece)
- ci: add stale workflow (c62fe26)
- chore: update dependencies (9629685)
- feat(parser): rename identifier to defineIdentifier and add IfMissingDefineIdentifier (526ce63)
What's Changed
- feat(parser): rename identifier to defineIdentifier and add IfMissing… by @RomainLanz in #44
Full Changelog: v6.1.1...v6.2.0
Update dependencies
6.1.1 (2025-01-11)
- chore: add release workflow (595d694)
- chore: update dependencies (5faeed1)
- chore: update to eslint 9 (15cf5eb)
- chore(package): correct author & contributors field (f75e8cf)
- chore(package): remove corepack field (ce41d99)
- ci: add labels workflow (bae355c)
- ci: update release-it config (fbfb69c)
- refactor: migrate to ts-node-maintained (a814ca1)
Full Changelog: v6.1.0...v6.1.1
Empty Example value
Changes
Added a third argument withEmptyExampleValue to the EnvEditor add method which allows to insert a empty value in the .env.example file
const editor = await EnvEditor.create(fs.baseUrl)
editor.add('SECRET_VALUE', 'key, true)This will result in SECRET_VALUE=key in the .env file, but with SECRET_VALUE= in the .env.example file.
Commits
Update dependencies
Allow to add identifiers
This release adds the possibility to define identifier.
The identifier is a string that prefix the environment variable value and let you customize the value resolution.
import { readFile } from 'node:fs/promises'
import { EnvParser } from '@adonisjs/env'
EnvParser.identifier('file', (value) => {
return readFile(value, 'utf-8')
})
const envParser = new EnvParser(`
DB_PASSWORD=file:/run/secret/db_password
`)
console.log(await envParser.parse()) // { DB_PASSWORD: 'Value from file /run/secret/db_password' }Breaking
The parse method of the EnvParser class is now async.
Commits
Update dependencies
- chore: update dependencies 60010d1
Full Changelog: v5.0.0...v5.0.1