• Generates a public example environment file from a given .env file. Can exclude specific lines from the file and check in to git.

    Parameters

    • options: Options = {}

      optional options object

    Returns Promise<ReturnValue>

    • object containing the paths and content of the input and output files

    Example

    import copyEnv from 'copy-env';

    const output = await copyEnv({
    cwd: process.cwd(),
    src: '.env',
    dest: '.env.sample',
    gitAdd: false,
    ignoreRegex: /^#/,
    });

    // return object
    // {
    // src: {
    // path: string,
    // content: string,
    // },
    // dest: {
    // path: string,
    // content: string,
    // },
    // }

Generated using TypeDoc