Function findNodeModule

  • Find the path to a node module in every parent directory (node_modules).

    Parameters

    • module: string

      Module name

    • dir: string = __dirname

      Directory to start searching from

    Returns string | undefined

    Path to the module or undefined if not found