Type checking for package.json
npm install types-pkg-json> Type checking for package.json.
Derived from type-fest with a focus on package.json types.
``bash`
yarn add types-pkg-json
`bash`
npm install types-pkg-json
`ts
import { PackageJSON, fileName, PackageJSONFileName } from "types-pkg-json"; // Type for NPM's package.json file
console.log(fileName); // "package.json"
`
#### Field Types
`tsbugs
import {
BugsLocation, // Used by the field.license
LicenseID, // Used by the and licenses.type fields.author
Person, // Used by the , contributors, and maintainers fields.directories
DirectoryLocations, // Used by the field.repository
Repository, // Used by the field.scripts
Scripts, // Used by the field.dependencies
Dependencies // Used by the , devDependencies, optionalDependencies, and peerDependencies fields.`
} from "types-pkg-json";
#### Configuration Types
`ts`
import {
NonStandardEntryPoints, // module, esnext, browser, sideEffects
TypeScriptConfiguration, // types, typings
WorkspaceConfig, // packages, nohoist
YarnConfiguration, // workspaces, flat, resolutions
JSPMConfiguration, // jspm
ESLintConfiguration // eslintConfig
} from "types-pkg-json";
#### Utility Types
`ts
import {
isJSONObject
JSONObject,
JSONValue,
JSONArray,
Primitive,
LiteralUnion
} from "types-pkg-json";
function isJSONObject(object?: JSONValue): object is JSONObject;
``
- types-json: Type checking for JSON objects
- types-eslintrc: Type checking for .eslintrc.json
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- types-json: Type checking for JSON objects
- types-tsconfig: Type checking for tsconfig.json
- types-eslintrc: Type checking for .eslintrc.json