{"by":"kevinslin","descendants":64,"id":46027878,"kids":[46063257,46062824,46062618,46062569,46063459,46062881,46062354,46062551,46069698,46063152,46064074,46063659,46065370,46063228,46066667,46065139,46070946,46062890,46067637,46063382,46063338,46062939],"score":90,"text":"This past quarter has been awash with sophisticated npm supply chain attacks like [Shai-Hulud](<a href=\"https:&#x2F;&#x2F;www.cisa.gov&#x2F;news-events&#x2F;alerts&#x2F;2025&#x2F;09&#x2F;23&#x2F;widespread-supply-chain-compromise-impacting-npm-ecosystem\" rel=\"nofollow\">https:&#x2F;&#x2F;www.cisa.gov&#x2F;news-events&#x2F;alerts&#x2F;2025&#x2F;09&#x2F;23&#x2F;widesprea...</a>() and the [Chalk&#x2F;debug Compromise](<a href=\"https:&#x2F;&#x2F;www.wiz.io&#x2F;blog&#x2F;widespread-npm-supply-chain-attack-breaking-down-impact-scope-across-debug-chalk\" rel=\"nofollow\">https:&#x2F;&#x2F;www.wiz.io&#x2F;blog&#x2F;widespread-npm-supply-chain-attack-b...</a>). This CLI helps protect users from recently compromised packages by only downloading packages that have been public for a while (default is 90 days or older).<p>Install: npm install -g @dendronhq&#x2F;safe-npm\nUsage: safe-npm install react@^18 lodash<p>How it works:\n- Queries npm registry for all versions matching your semver range\n- Filters out anything published in the last 90 days\n- Installs the newest &quot;aged&quot; version<p>Limitations:\n- Won&#x27;t protect against packages malicious from day one\n- Doesn&#x27;t control transitive dependencies (yet - looking into overrides)\n- Delays access to legitimate new features<p>This is meant as a 80&#x2F;20 measure against recently compromised NPM packages and is not a silver bullet. Please give it a try and let me know if you have feedback.","time":1763936054,"title":"Show HN: Safe-NPM – only install packages that are +90 days old","type":"story","url":"https://github.com/kevinslin/safe-npm"}