Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bconnorwhite/types-pkg-json
Type checking for package.json
https://github.com/bconnorwhite/types-pkg-json
Last synced: 4 days ago
JSON representation
Type checking for package.json
- Host: GitHub
- URL: https://github.com/bconnorwhite/types-pkg-json
- Owner: bconnorwhite
- Created: 2020-09-08T02:13:57.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T04:02:16.000Z (about 4 years ago)
- Last Synced: 2024-04-27T03:02:22.978Z (7 months ago)
- Language: TypeScript
- Size: 381 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
> Type checking for package.json.
Derived from [type-fest](https://www.npmjs.com/package/type-fest) with a focus on package.json types.
## Installation
```bash
yarn add types-pkg-json
``````bash
npm install types-pkg-json
```## API
### Types
```ts
import { PackageJSON, fileName, PackageJSONFileName } from "types-pkg-json"; // Type for NPM's package.json fileconsole.log(fileName); // "package.json"
```#### Field Types
```ts
import {
BugsLocation, // Used by the `bugs` field.
LicenseID, // Used by the `license` and `licenses.type` fields.
Person, // Used by the `author`, `contributors`, and `maintainers` fields.
DirectoryLocations, // Used by the `directories` field.
Repository, // Used by the `repository` field.
Scripts, // Used by the `scripts` field.
Dependencies // Used by the `dependencies`, `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;
```
Dependencies
- [types-json](https://www.npmjs.com/package/types-json): Type checking for JSON objects
- [types-eslintrc](https://www.npmjs.com/package/types-eslintrc): Type checking for .eslintrc.json
Dev Dependencies
- [@bconnorwhite/bob](https://www.npmjs.com/package/@bconnorwhite/bob): Bob is a toolkit for TypeScript projects
License
[MIT](https://opensource.org/licenses/MIT)
## Related Projects
- [types-json](https://www.npmjs.com/package/types-json): Type checking for JSON objects
- [types-tsconfig](https://www.npmjs.com/package/types-tsconfig): Type checking for tsconfig.json
- [types-eslintrc](https://www.npmjs.com/package/types-eslintrc): Type checking for .eslintrc.json