Class PackageInfo

Information collected for package from its package.json.

Hierarchy

  • PackageInfo

Constructors

Accessors

  • get localName(): string
  • Local name within package scope.

    Part of the name after the the slash / for scoped package, or the name itself for unscoped one.

    Returns string

  • get name(): string
  • Full package name as specified in package.json.

    When missing, defaults to -.

    Returns string

  • get scope(): undefined | `@${string}`
  • Resolved package scope. I.e. the part of the name after @ prefix, if any.

    Returns undefined | `@${string}`

  • get type(): "module" | "commonjs"
  • The type of the package.

    This is module only if package type set to module. Otherwise, it's a commonjs.

    Returns "module" | "commonjs"

Methods

  • Loads package info from package,json file at the given path.

    Parameters

    • path: string = 'package.json'

      Path to package.json file. package.json by default.

    Returns Promise<PackageInfo>

    Promise resolved to the loaded package info.

Generated using TypeDoc