Skip to content

Dot-Env Conversion v2.0.0

Choose a tag to compare

@linhntaim linhntaim released this 04 Oct 16:33
· 38 commits to master since this release

Rework from v1:

  • Fresh code base with the same idea.
  • Main features are nearly the same.
  • Changes:
    • make method is now convert.
    • env property that keeps converting results is removed.
    • getenv method with the default-value feature is removed.
    • Auto-conversion works slightly differently:
      • Case-sensitive is enabled.
      • null conversion is removed from public access (i.e. you cannot override it) (considered as a fixed conversion) and returns null value instead of empty string; values to be null is different from v1 (due to case-sensitive).
      • bool conversion is now boolean; values to be false or true is different from v1 (due to case-sensitive).
      • raw conversion is now string.
      • number conversion: update regex to match a number.
      • array conversion has the logic different from v1 (now uses JSON.parse instead of custom parsing).
      • json conversion is now object.
      • New values to handle: undefined, NaN, Infinity.
      • string conversion is now used by default instead of json (now: object) as in v1. And it is used by default not only for Auto-conversion but everywhere.
  • New features:
    • New conversions: undefined (fixed conversion), bigint, symbol.
    • Method aliases:
      • bool is now an alias to boolean conversion.

See README.md file for new documentation.