npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anolilab/semantic-release-clean-package-json

v5.2.0

Published

Clean package.json before publish by removing unnecessary properties.

Readme

typescript-image mit licence npm downloads Chat PRs Welcome



Why?

When publishing packages to npm, many properties in package.json are only needed during development and build time, but not in the published package. This plugin automatically removes unnecessary properties while preserving essential ones needed for the package to work correctly in production.

Key benefits:

  • Reduces package size by removing development-only properties
  • Prevents leaking internal configuration and metadata
  • Maintains a clean and focused package.json for end users
  • Customizable property preservation through configuration

Install

npm install @anolilab/semantic-release-clean-package-json
yarn add @anolilab/semantic-release-clean-package-json
pnpm add @anolilab/semantic-release-clean-package-json

Usage

The plugin can be configured in the semantic-release configuration file:

[!IMPORTANT] Very important: The plugin must be placed before the @semantic-release/github or @semantic-release/git and before @anolilab/semantic-release-pnpm or @semantic-release/npm plugin otherwise the package.json will be cleaned and published into GitHub / Your Git Provider.

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@anolilab/semantic-release-clean-package-json",
        "@anolilab/semantic-release-pnpm",
        "@semantic-release/github"
    ]
}

Steps that are used

| Step | Description | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | publish | - Creates a backup of the original package.json file- Removes all non-preserved properties from package.json- Keeps properties specified in the default list and custom keep option- Preserves specific npm scripts if they are in the keep list- Writes the cleaned package.json file | | success | - Restores the original package.json from backup- Updates the version number to match the released version- Removes the backup file- Logs success or error messages |

Options

| Options | Description | Default | | --------- | -------------------------- | ------- | | pkgRoot | Directory path to publish. | . | | keep | Property names to keep. | [] |

Note: The pkgRoot directory must contain a package.json. The version will be updated only in the package.json and npm-shrinkwrap.json within the pkgRoot directory.

Note: If you use a shareable configuration that defines one of these options you can set it to false in your semantic-release configuration in order to use the default value.

Examples

The plugin can be configured with custom properties to keep in addition to the default preserved ones:

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "@anolilab/semantic-release-clean-package-json",
            {
                "keep": ["custom field"]
            }
        ],
        "@anolilab/semantic-release-pnpm",
        "@semantic-release/github"
    ]
}

Example: Publishing a TypeScript Package

When publishing a TypeScript package, you might want to keep TypeScript-specific fields:

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "@anolilab/semantic-release-clean-package-json",
            {
                // This are the default values, just a example
                "keep": ["types", "typings", "typesVersions", "module"],
            },
        ],
        "@anolilab/semantic-release-pnpm",
        "@semantic-release/github",
    ],
}

Example: Custom Package Root

If your package.json is not in the root directory:

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@semantic-release/github",
        [
            "@anolilab/semantic-release-clean-package-json",
            {
                "pkgRoot": "dist"
            }
        ],
        "@anolilab/semantic-release-pnpm"
    ]
}

Default preserved properties

By default, these properties are preserved in package.json:

npm

  • name
  • version
  • private
  • publishConfig
  • scripts.preinstall
  • scripts.install
  • scripts.postinstall
  • scripts.dependencies
  • files
  • bin
  • browser
  • main
  • man
  • dependencies
  • peerDependencies
  • peerDependenciesMeta
  • bundledDependencies
  • optionalDependencies
  • engines
  • os
  • cpu
  • description
  • keywords
  • author
  • contributors
  • license
  • homepage
  • repository
  • bugs
  • funding

CDNs

Node.js

  • type
  • exports
  • imports

VSCode Extension Manifest

  • publisher
  • displayName
  • categories
  • galleryBanner
  • preview
  • contributes
  • activationEvents
  • badges
  • markdown
  • qna
  • sponsor
  • extensionPack
  • extensionDependencies
  • extensionKind
  • icon

Angular Package Format

  • fesm2020
  • fesm2015
  • esm2020
  • es2020

TypeScript

  • types
  • typings
  • typesVersions

Bundlers (Webpack, Rollup, esbuild)

Supported Node.js Versions

Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.

Contributing

If you would like to help take a look at the list of issues and check our Contributing guidelines.

Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits

Made with ❤️ at Anolilab

This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Anolilab is a Development and AI Studio. Contact us at [email protected] if you need any help with these technologies or just want to say hi!

License

The anolilab semantic-release-clean-package-json is open-sourced software licensed under the MIT