SShortSingh.
Back to feed

npm publish silently ignores .gitignore when a .npmignore file is present

0
·16 views

When an npm package is audited using 'npm pack --dry-run', developers may discover that sensitive files excluded in .gitignore are actually being published to the registry. This happens because npm follows a strict priority order — the 'files' array in package.json, then .npmignore, then .gitignore — stopping at the first match it finds. Adding even a minimal .npmignore file completely overrides all .gitignore rules, without any warning from npm. npm's built-in always-excluded list is narrow and does not cover common sensitive files such as .env files, private keys, or internal notes. Experts recommend using the 'files' whitelist in package.json instead of .npmignore, and verifying tarball contents in CI to prevent accidental data exposure.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

DEV Seeks Full-Time Community Manager to Steward Its Developer Community

DEV has reshaped an earlier Community Program Manager opening into a full-time Community Manager role focused on community stewardship rather than program management. The position centers on daily presence on the platform, including publishing, engaging with members, and maintaining a welcoming, high-quality environment. Responsibilities include moderation, managing community support channels, overseeing brand presences such as the MLH organization, and curating content through roundups and newsletters. Candidates are expected to be established DEV members with experience running Discord communities, and the package includes a competitive salary, stock options, health and retirement benefits, unlimited PTO, and travel opportunities.

0
ProgrammingHacker News ·

Part 2 of PwnEscape Details a Firecracker VM Escape

A security write-up titled "Firecracker VM Escape: PwnEscape Part 2" was published on pwn.ai and shared on Hacker News. The source material indicates it is a follow-up in a series about escaping Firecracker, the lightweight virtual machine monitor used for isolated workloads. The available text is limited to the link and metadata, with four points and no comments at the time of capture. Specific technical details of the vulnerability or exploit are not included in the information provided. Readers would need to consult the original article for the full findings.

0
ProgrammingHacker News ·

A Personal Essay Recounts a Telegram Sent From Rebecca West

A piece published on The Lamp magazine's blog recalls a telegram the author received from the writer Rebecca West. The author describes it as the only telegram they ever received, giving it particular significance. The essay appears to center on West's correspondence and its personal impact. The item was shared on Hacker News, where it gathered six points and no comments at the time of capture. The available text provides limited detail beyond the premise, so the full essay should be consulted for specifics.

0
ProgrammingHacker News ·

Democrats Open Congressional Probes Into SpaceX AI, Meta and Apple

Democratic lawmakers are launching congressional investigations into SpaceX's AI operations, Meta and Apple, according to a Washington Post report. The probes follow a period in which many large corporations courted the Trump administration. The source material provided is limited to the headline and a link, so specific allegations, timelines and the scope of each inquiry are not confirmed here. The article frames the moves as a reckoning for corporate America after its earlier engagement with the White House. Further details would need to be verified against the full Washington Post coverage.