Function isNodeEnv

  • Handles an input value as string and checks if its string representation has the same value as NODE_ENV environment variable (case insensitive).

    Example

    // NODE_ENV === 'development'
    isNodeEnv('development') // (true)
    isNodeEnv('Development') // (true)
    isNodeEnv('DEVELOPMENT') // (true)
    isNodeEnv('production') // (false)
    isNodeEnv('Production') // (false)
    isNodeEnv('PRODUCTION') // (false)

    Returns

    (true), NODE_ENV is set to 'production'.

    Parameters

    • name: any

      The name to check.

    Returns boolean

Generated using TypeDoc