An interface that represents a package.json

interface PackageJson {
    author?: string;
    dependencies?: {
        [key: string]: string;
    };
    devDependencies?: {
        [key: string]: string;
    };
    name?: string;
    oclif?: {
        plugins?: string[];
    };
    overrides?: {
        [key: string]: string;
    };
    peerDependencies?: {
        [key: string]: string;
    };
    prettier?: string;
    private?: boolean;
    resolutions?: {
        [key: string]: string;
    };
    scripts?: {
        [key: string]: string;
    };
    version?: string;
    workspaces?: string[];
}

Properties

author?: string

The author attribute of the package.json

dependencies?: {
    [key: string]: string;
}

The dependencies attribute of the package.json

Type declaration

  • [key: string]: string
devDependencies?: {
    [key: string]: string;
}

The devDependencies attribute of the package.json

Type declaration

  • [key: string]: string
name?: string

The name attribute of the package.json

oclif?: {
    plugins?: string[];
}

The optional oclif settings attribute of the package.json

Type declaration

  • Optional plugins?: string[]
overrides?: {
    [key: string]: string;
}

The overrides attribute of the package.json. Only useful when using npm o npmn as package managers

Type declaration

  • [key: string]: string
peerDependencies?: {
    [key: string]: string;
}

The peerDependencies attribute of the package.json

Type declaration

  • [key: string]: string
prettier?: string

The prettier attribute of the package.json

private?: boolean

The private attribute of the package.json. https://docs.npmjs.com/cli/v9/configuring-npm/package-json#private

resolutions?: {
    [key: string]: string;
}

The resolutions attribute of the package.json. Only useful when using yarn as package manager

Type declaration

  • [key: string]: string
scripts?: {
    [key: string]: string;
}

The scripts attribute of the package.json

Type declaration

  • [key: string]: string
version?: string

The version attribute of the package.json

workspaces?: string[]

The workspaces attribute of the package.json