types-package-json
Advanced tools
Comparing version 0.0.1-0 to 0.0.10
{ | ||
"name": "types-package-json", | ||
"version": "0.0.1-0", | ||
"version": "0.0.10", | ||
"license": "GPL-3.0", | ||
"files": [ | ||
"dist" | ||
], | ||
"author": "Artur Kurowski <radarsu@gmail.com>", | ||
"homepage": "https://github.com/radarsu/types-package-json#readme", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"typescript": "^3.9.5", | ||
"chalk": "^4.1.0" | ||
"chalk": "^4.1.0", | ||
"@radrat/cli": "0.0.15" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# Description | ||
# types-package-json | ||
@@ -9,2 +9,4 @@ 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. | ||
`npm i -D types-package-json` | ||
```ts | ||
@@ -14,3 +16,3 @@ import { IPackageJson } from 'types-package-json'; | ||
const packageJsonPath = path.resolve(process.cwd(), `package.json`); | ||
const packageJson: IPackageJson = await import(packageJsonPath); | ||
const packageJson: Partial<IPackageJson> = await import(packageJsonPath); | ||
``` | ||
@@ -17,0 +19,0 @@ |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1
26
3197
3
4
49