Documentation
    Preparing search index...

    Environment editor for managing and modifying .env files. Provides functionality to load, edit, and save environment configuration files.

    Index

    Constructors

    Methods

    Constructors

    • Constructs a new EnvEditor instance

      Parameters

      • appRoot: URL

        The application root directory URL

      Returns EnvEditor

    Methods

    • Creates an instance of env editor and loads .env files contents.

      Parameters

      • appRoot: URL

        The application root directory URL

      Returns Promise<EnvEditor>

      Promise resolving to an EnvEditor instance

    • Loads .env files for editing. Only ".env" and ".env.example" files are picked for editing.

      Returns Promise<void>

      Promise that resolves when files are loaded

    • Add key-value pair to the dot-env files. If withEmptyExampleValue is true then the key will be added with an empty value to the .env.example file.

      Parameters

      • key: string

        The environment variable key

      • value: string | number | boolean

        The environment variable value

      • withEmptyExampleValue: boolean = false

        Whether to add empty value to .env.example file

      Returns void

    • Returns the loaded files as JSON

      Returns { contents: string[]; path: string }[]

      Array of file objects with contents and paths

    • Save changes to the disk

      Returns Promise<void>

      Promise that resolves when files are saved