- Add
AsSet()
accessor (#173)
- Fix docstrings for positive/negative int/float validators (#172)
- Fix 7.4.0 issues with
create-react-app
polyfill (#168)
- Do not use
process.env
by default in non-Node.js environments (#155)
- Fix parsing even floating point numbers (#166)
- Add missing
asEmailString()
typings (#160)
- Add
asEmailString()
accessor (#146)
- Fix duplicate identifier error for TypeScript builds (#151)
- Support type narrowed
process.env
/record and remove unused type (#148) - Add support for
readonly T[]
generic use withasEnum()
- Fix loose float and int parsing (PR #144)
- Drop support for Node.js 8 and 13 (support only current, active, and maintenance versions)
- Improve support for browser usage (#138)
- Fix documentation errors (#139)
- Add
asRegExp
accessor (#136) - Add better TypeScript example for custom accessors (#133)
- Add
accessors
property to the public API for use in buildingextraAccessors
(#121) - Add support for logging with a built-in or custom logger (#112)
- Add Node.js v14 to CI builds
- Add single quote rule to
.editorconfig
(#129) - Add JavaScript example for
extraAccesors
(#129) - Fix
extraAccessors
args type error (#131) - Fix types and docs for
asUrlString()
andasUrlObject()
(#132) - Update README for
asUrlString()
to mention WHATWG URL behaviour (#126, #129)
- Fix TS error with ExtenderTypeOptional and ExtenderType typings (#119)
- Fix TS error with extraAccessor typings (#114)
- Add support for generic types in asEnum (#116)
- Fix compilation error caused by typings generic issue.
- Fix typings to support
required()
,convertFromBase64()
, etc. withExtensionFn
.
- Fix
default()
so that it correctly returns an empty string value if provided. - README improvement by @joh-klein for positive/negative number parsing rules.
- Fix typings for the
default(value)
function.
- Add support for setting an example value via the
example(string)
function. - Passing default values is now performed using the
default(string)
function. - Defer checks for
required()
until an accessor such asasString()
is invoked. - Fix typings issue where
required()
was undefined on aIPresentVariable
. - Improve error message output.
Migration from 5.x to 6.0.0 should be smooth. Change any instance of
env.get(target, default)
to env.get(target).default(default)
. For example:
// Old 5.x code
const emailAddr = env.get('EMAIL_ADDR', '[email protected]').asString()
// New 6.x compatible code
const emailAddr = env.get('EMAIL_ADDR').default('[email protected]').asString()
- The
required()
function now verifies the variable is not an empty string
- Ability to add custom accessors in PR #72 (thanks @todofixthis)
- Improved TypeScript tests
- Fixed warning generated by husky
- Return values from
asArray()
are now more intuitive & consitent asUrlString()
andasUrlObject
now use the built-inURL
class in Node.js to perform validation- README updated in accordance with changes listed above
- Add
asPortNumber()
function - Update documentation structure
- Add node
process.env
typings toenv.from
- Rename
.env.mock()
toenv.from()
- Change module internals per issue #39
- Update docs related to
env.mock
- Update
required()
to support boolean paramter to bypass the check
- Fix README badge copy/paste error
- Fix TypeScript definition for "asBoolStrict" function name
- Add
convertFromBase64()
function - Enable Greenkeeper
- Add
asEnum
functionality
- Remove @types/node dependency
- Update typings to correctly handle default values for numeric types.
- Ensure an error is thrown when
asArray
does not detect at least a single non-empty value.
- Restore support for use in browser based applications
- Fix bug that caused default values to be ignored
- Public API no longer is a function, instead exposes two functions,
mock
andget
- Drop support for Node.js versions less than 4.0
- Rename
asPositiveInt
toasIntPositive
- Rename
asNegativeInt
toasIntNegative
- Rename
asStrictBool
toasBoolStrict
- Add
asFloatPositive
andasFloatNegative
- Add
asUrlString
andasUrlObject
- Refactor code with consistent errors and structure
- Use
standard
for code quality and formatting
- Update with build, coverage, and version information badges
- Fix TypeScript definition file
- Remove unnecessary code path
- Add
asArray([delimeter])
to read environment variables as an array by splitting the varible string on each instance of delimeter; - Add
asJsonArray()
to read in an environment variable that contains a JSON Array. Similar toasJson()
, but ensures the variable is an Array. - Add
asJsonObject()
to read in an environment variable that contains a JSON Object. Similar toasJson()
, but ensures the variable is an Object.
- Add typings support for TypeScript
- Thanks to @itavy for a patch for our asBool parsing and adding the new asStrictBool function
- Added env.mock PR from @MikeyBurkman to improve testability
- Add CI process for node 6, 5, 4, and 0.10
- Add chained functions for variable validations
- Add assertions for required() and various type checks, e.g asPositiveInt()
- Remove node 0.8.x support
- Remove old pattern of returning variables directly
- Continue support for defaults from 1.X
- Venture forth at thine own risk, for here be dragons