Utility TypeScript @ 2.0.0-beta
    Preparing search index...

    Interface PackageJson

    The general shape of most package.json (npm) files.

    Taken from NPM docs. Last updated 2025-05-14.

    2.0.0-alpha

    interface PackageJson {
        name: string;
        version: string;
        author?: string | { name: string; email?: string; url?: string };
        bin?: string | { [key: string]: string };
        browser?: string;
        bugs?: { email?: string; url?: string };
        bundleDependencies?: string[];
        config?: { [key: string | number]: any };
        contributors?: (string | { name: string; email?: string; url?: string })[];
        cpu?: string[];
        dependencies?: { [key: string]: string };
        description?: string;
        devDependencies?: { [key: string]: string };
        directories?: { [key: string]: string };
        engines?: { [key: string]: string };
        files?: string[];
        funding?:
            | string
            | { type: string; url: string }
            | (string | { type: string; url: string })[];
        homepage?: string;
        keywords?: string[];
        license?: string;
        main?: string;
        man?: string | string[];
        optionalDependencies?: { [key: string]: string };
        os?: string[];
        overrides?: PackageJson_Overrides;
        peerDependencies?: { [key: string]: string };
        peerDependenciesMeta?: { [key: string]: { [key: string]: string } };
        private?: boolean;
        publishConfig?: { [key: string]: string | number | boolean };
        repository?: string | { type: string; url: string; directory?: string };
        scripts?: { [key: string]: string };
        workspaces?: string[];
    }
    Index

    Properties

    name: string

    Name of the package.

    Some rules:

    The name must be less than or equal to 214 characters. This includes the scope for scoped packages.

    The names of scoped packages can begin with a dot or an underscore. This is not permitted without a scope.

    New packages must not have uppercase letters in the name.

    The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters

    version: string

    Current package version.

    Version must be parseable by node-semver, which is bundled with npm as a dependency.

    author?: string | { name: string; email?: string; url?: string }
    bin?: string | { [key: string]: string }
    browser?: string
    bugs?: { email?: string; url?: string }
    bundleDependencies?: string[]
    config?: { [key: string | number]: any }
    contributors?: (string | { name: string; email?: string; url?: string })[]
    cpu?: string[]
    dependencies?: { [key: string]: string }
    description?: string
    devDependencies?: { [key: string]: string }
    directories?: { [key: string]: string }
    engines?: { [key: string]: string }
    files?: string[]
    funding?:
        | string
        | { type: string; url: string }
        | (string | { type: string; url: string })[]
    homepage?: string
    keywords?: string[]
    license?: string
    main?: string
    man?: string | string[]
    optionalDependencies?: { [key: string]: string }
    os?: string[]
    peerDependencies?: { [key: string]: string }
    peerDependenciesMeta?: { [key: string]: { [key: string]: string } }
    private?: boolean
    publishConfig?: { [key: string]: string | number | boolean }
    repository?: string | { type: string; url: string; directory?: string }
    scripts?: { [key: string]: string }
    workspaces?: string[]