{"id":22619830,"url":"https://github.com/simonkovtyk/esbuild-plugin-package-json","last_synced_at":"2026-02-02T19:38:18.593Z","repository":{"id":255902571,"uuid":"853816537","full_name":"simonkovtyk/esbuild-plugin-package-json","owner":"simonkovtyk","description":"Prepares the package.json by removing all unnecessary fields and copying it to the output folder of esbuild.","archived":false,"fork":false,"pushed_at":"2024-11-17T00:08:48.000Z","size":66,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T17:14:48.984Z","etag":null,"topics":["esbuild","esbuild-package-json","esbuild-plugin","esbuild-plugins","package-json","package-json-prepare","package-json-updater","prepare-package-json"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonkovtyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-07T16:06:15.000Z","updated_at":"2024-11-17T00:08:51.000Z","dependencies_parsed_at":"2025-04-11T15:21:57.032Z","dependency_job_id":"29cad397-7f53-4ed0-b9ec-c544f7496e13","html_url":"https://github.com/simonkovtyk/esbuild-plugin-package-json","commit_stats":null,"previous_names":["simonkovtyk/esbuild-plugin-package-json"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simonkovtyk/esbuild-plugin-package-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-package-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-package-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-package-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-package-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonkovtyk","download_url":"https://codeload.github.com/simonkovtyk/esbuild-plugin-package-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonkovtyk%2Fesbuild-plugin-package-json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259895614,"owners_count":22928295,"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":["esbuild","esbuild-package-json","esbuild-plugin","esbuild-plugins","package-json","package-json-prepare","package-json-updater","prepare-package-json"],"created_at":"2024-12-08T22:09:17.325Z","updated_at":"2026-02-02T19:38:13.546Z","avatar_url":"https://github.com/simonkovtyk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"196\" src=\"https://raw.githubusercontent.com/simonkovtyk/esbuild-plugin-package-json/d7d77d5766ef9ef97f157c2d221d61a7d3cef51c/docs/esbuild-favicon.svg\" /\u003e\n\n\u003ch1\u003epackage.json Plugin\u003c/h1\u003e\n\n\u003cp\u003ePrepares the package.json by removing all unnecessary fields and\u003cbr/\u003ecopying it to the output folder of esbuild.\u003c/p\u003e\n\n![NPM Downloads](https://img.shields.io/npm/dw/esbuild-plugin-package-json)\n![NPM License](https://img.shields.io/npm/l/esbuild-plugin-package-json)\n![GitHub package.json version](https://img.shields.io/npm/v/esbuild-plugin-package-json)\n![TypeScript types](https://img.shields.io/badge/TypeScript_types-included-blue)\n\n\u003cbr /\u003e\n\nAdd a ⭐ to this repository — *it motivates me a lot!*\n\n\u003c/div\u003e\n\n## ⚡️ Getting started\n\nSimply install this package with your package manager.\n\n````shell\nnpm install -D esbuild-plugin-package-json\n````\n\n\u003cdetails\u003e\n\u003csummary\u003e📦 other package manager\u003c/summary\u003e\n\nHere are examples for installing the package with other package manager.\n\n\u003e 💾 **yarn**\n\u003e ````shell\n\u003e yarn add -D esbuild-plugin-package-json\n\u003e ````\n\n\u003e 💾 **pnpm**\n\u003e ````shell\n\u003e pnpm install -D esbuild-plugin-package-json\n\u003e ````\n\n\u003c/details\u003e\n\nLooks good so far 🔥 — now you have installed the latest version!\n\n## 💡 Introduction\n\nWhile a package is a relase candidate, there are a few fields, that may are considered as a security vulnerability or are just not needed in the published package.\n\nThe following fields can be safely removed:\n````json5\n{\n  \"scripts\": {\n    // something here...\n  },\n  \"devDependencies\": {\n    // something here...\n  }\n}\n````\n\n## 🔧 Usage\n\n```typescript\npackageJsonPlugin(options);\n```\n\nThis function needs to be called inside the esbuild configuration in order to use this plugin. It will provide the plugin inside the build process of esbuild.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example of the integration\u003c/summary\u003e\n\n````typescript\nesbuild.build({\n  // some configuration...\n  plugins: [\n    packageJsonPlugin();\n    // more plugins here...\n  ]\n})\n````\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example of the configuration\u003c/summary\u003e\n\n````typescript\npackageJsonPlugin({\n  // configure here\n});\n````\n\u003c/details\u003e\n\n### Properties\n\n#### ``lifecycle``\n\n\u003e Default: ``onEnd``\n\nAn string with either the value ``onStart`` or ``onEnd``.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\npackageJsonPlugin({\n  lifecycle: \"onStart\"\n});\n````\n\u003c/details\u003e\n\n[See here](https://esbuild.github.io/plugins/#concepts) for more about esbuild lifecycles.\n\n#### ``overrideOut``\n\n\u003e Default: ``undefined`` (esbuild's output directory)\n\nA ``string``, that specifies the output directory for the package.json.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\npackageJsonPlugin({\n  overrideOut: \"dist\" // any directory allowed\n});\n````\n\n\u003c/details\u003e\n\n#### ``overridePackageJson``\n\n\u003e Default: ``undefined`` (npm default)\n\nYou can override the start directory for the package.json search, if a ``string`` is provided here.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow an example\u003c/summary\u003e\n\n````typescript\npackageJsonPlugin({\n  overridePackageJson: \"libs/my-lib\" // any directory allowed\n});\n````\n\n\u003c/details\u003e\n\n### Returns\n\nType: ``Plugin``\n\nAn instance of this plugin, that will be used by esbuild automatically.\n\n## License\n\nThe MIT License (MIT) - Please have a look at the [License](https://github.com/simonkovtyk/esbuild-plugin-package-json/blob/main/LICENSE) file for more details.\n\n## Contributing\n\nWant to contribute to an open-source project on GitHub but unsure where to start? Check out this comprehensive step-by-step guide on how to contribute effectively!\n\nFrom forking the repository to creating pull requests, this guide walks you through every stage of the process, helping you make a successful contribution to this GitHub project. Start collaborating, learn new skills, and make an\nimpact on this project!\n\n[See here](https://github.com/simonkovtyk/esbuild-plugin-package-json/blob/main/docs/guides/HOW_TO_CONTRIBUTE.md) for the contribute guide at GitHub.\n\n\u003chr\u003e\n\nGitHub [@simonkovtyk](https://github.com/simonkovtyk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-package-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-package-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonkovtyk%2Fesbuild-plugin-package-json/lists"}