Script to remove unnecessary properties from package.json on prepublish hook
-
Updated
Jun 18, 2026 - TypeScript
Script to remove unnecessary properties from package.json on prepublish hook
The CLI utility "npm-previewpkg" generates an overview of the files and directories, which would be part of an npm package when published: a package content preview.
Clean package.json before publishing your package by removing unnecessary properties.
🛡️ The last line of defense before your npm token spreads a worm. Pre-publish tripwire that blocks self-replicating supply-chain worms (Shai-Hulud class). Zero deps, zero network, SARIF output.
Add a description, image, and links to the prepublish topic page so that developers can more easily learn about it.
To associate your repository with the prepublish topic, visit your repo's landing page and select "manage topics."