{"id":20068668,"url":"https://github.com/radarsu/types-package-json","last_synced_at":"2025-08-08T02:09:57.962Z","repository":{"id":39663199,"uuid":"277554301","full_name":"radarsu/types-package-json","owner":"radarsu","description":"A handful set of package.json types and interfaces to improve working with dynamically imported package.json files.","archived":false,"fork":false,"pushed_at":"2022-05-28T13:21:32.000Z","size":2,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-20T01:48:17.609Z","etag":null,"topics":["dynamic","import","interface","json","package-json","types"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radarsu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-06T13:48:48.000Z","updated_at":"2024-08-25T12:26:53.000Z","dependencies_parsed_at":"2022-09-20T07:41:25.529Z","dependency_job_id":null,"html_url":"https://github.com/radarsu/types-package-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radarsu%2Ftypes-package-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radarsu%2Ftypes-package-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radarsu%2Ftypes-package-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radarsu%2Ftypes-package-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radarsu","download_url":"https://codeload.github.com/radarsu/types-package-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224099654,"owners_count":17255578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamic","import","interface","json","package-json","types"],"created_at":"2024-11-13T14:08:05.326Z","updated_at":"2024-11-13T14:08:05.936Z","avatar_url":"https://github.com/radarsu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# types-package-json\n\nA 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.\n\n\u003e Based on npm package.json documentation: https://docs.npmjs.com/files/package.json\n\n# Usage\n\n`npm i -D types-package-json`\n\n```ts\nimport { IPackageJson } from 'types-package-json';\n\nconst packageJsonPath = path.resolve(process.cwd(), `package.json`);\nconst packageJson: Partial\u003cIPackageJson\u003e = await import(packageJsonPath);\n```\n\n# Features\n\n-   **Zero overhead** - contains only types and interfaces, no actual objects.\n-   **I prefixed** - all interfaces are prefiexed with I to avoid misunderstanding interface with a class and decrease naming overlaps.\n-   **IPackageJson** - full package.json interface, name and version is required\n-   **IPackageJsonAddress** - optional email and url\n-   **IPackageJsonPerson** - required name, optional email and url\n-   **IPackageJsonDependencyTypes** - 'dependencies' | 'devDependencies' | 'peerDependencies' | 'optionalDependencies' (bundledDependencies are not included in this type as they serve different purpose).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradarsu%2Ftypes-package-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradarsu%2Ftypes-package-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradarsu%2Ftypes-package-json/lists"}