types-package-json
Advanced tools
Comparing version 0.0.43 to 0.0.72-1
{ | ||
"name": "types-package-json", | ||
"version": "0.0.43", | ||
"description": "A handful set of package.json types and interfaces.", | ||
"version": "0.0.72-1", | ||
"description": "A handful set of package.json types and interfaces to improve working with dynamically imported package.json files.", | ||
"keywords": [ | ||
"@types/package-json", | ||
"dynamic", | ||
"import", | ||
"interface", | ||
@@ -20,9 +22,8 @@ "package.json", | ||
"devDependencies": { | ||
"@radrat-node/execute": "0.0.43", | ||
"@radrat-scripts/package": "0.0.43", | ||
"@radrat/cli": "0.0.64", | ||
"@radrat-scripts/package": "0.0.72-1", | ||
"@radrat-scripts/readme": "0.0.72-1", | ||
"@radrat/cli": "0.0.72-1", | ||
"@types/node": "^14.6.0", | ||
"chalk": "^4.1.0", | ||
"typescript": "^3.9.7" | ||
"typescript": "^4.0.2" | ||
} | ||
} |
@@ -1,11 +0,21 @@ | ||
# types-package-json | ||
<p align="center"> | ||
<h1>types-package-json</h1> | ||
<div>A handful set of package.json types and interfaces to improve working with dynamically imported package.json files.</div> | ||
</p> | ||
A handful set of **package.json** types and interfaces to improve working with dynamically imported **package.json** files. **@types/package-json** became deprecated as **package.json** files imported by typescript come with it's own type definitions. Sometimes though, when you import files dynamically type becomes **any** and that's when this package becomes useful. | ||
## Table of contents | ||
> Based on npm package.json documentation: https://docs.npmjs.com/files/package.json | ||
1. [Getting Started](#getting-started) | ||
# Installation | ||
2. [Usage](#usage) | ||
3. [Features](#features) | ||
## Getting Started | ||
`npm i -D types-package-json` | ||
## Usage | ||
```ts | ||
@@ -18,9 +28,10 @@ import { IPackageJson } from 'types-package-json'; | ||
# Features | ||
- **Zero overhead** - contains only types and interfaces, no actual objects. | ||
- **I prefixed** - all interfaces are prefiexed with I to avoid misunderstanding interface with a class and decrease naming overlaps. | ||
- **IPackageJson** - full package.json interface, name and version is required | ||
- **IPackageJsonAddress** - optional email and url | ||
- **IPackageJsonPerson** - required name, optional email and url | ||
- **IPackageJsonDependencyTypes** - 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies' (bundledDependencies are not included in this type as they serve different purpose). | ||
## Features | ||
**Zero overhead** - contains only types and interfaces, no actual objects. | ||
**I prefixed** - all interfaces are prefiexed with I to avoid misunderstanding interface with a class and decrease naming overlaps. | ||
**IPackageJson** - full package.json interface, name and version is required | ||
**IPackageJsonAddress** - optional email and url | ||
**IPackageJsonPerson** - required name, optional email and url | ||
**IPackageJsonDependencyTypes** - 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies' (bundledDependencies are not included in this type as they serve different purpose). | ||
5
37
3272