<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Npm on Commentary of Takao</title><link>https://takao.blog/en/tags/npm/</link><description>Recent content in Npm on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/en/tags/npm/index.xml" rel="self" type="application/rss+xml"/><item><title>Exporting Proper TypeScript Declaration Files (.d.ts) for NPM</title><link>https://takao.blog/en/web/typescript-declaration-files-dts/</link><pubDate>Sun, 10 May 2026 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/typescript-declaration-files-dts/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Exporting Proper TypeScript Declaration Files (.d.ts) for NPM" /&gt;&lt;h2 id="why-declaration-files-matter"&gt;Why Declaration Files Matter
&lt;/h2&gt;&lt;p&gt;When you publish an npm package written in TypeScript, consumers need type information to get IntelliSense and compile-time checking. Without &lt;code&gt;.d.ts&lt;/code&gt; files, your library is effectively typed as &lt;code&gt;any&lt;/code&gt;, defeating the purpose of using TypeScript in the first place.&lt;/p&gt;
&lt;p&gt;Declaration files describe the shape of your exports without shipping the implementation source. They enable tree-shaking, documentation hover tips, and strict type checking in consumer projects.&lt;/p&gt;
&lt;h2 id="generating-dts-files"&gt;Generating .d.ts Files
&lt;/h2&gt;&lt;p&gt;The TypeScript compiler generates declaration files when &lt;code&gt;declaration&lt;/code&gt; is set to &lt;code&gt;true&lt;/code&gt; in &lt;code&gt;tsconfig.json&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Auditing NPM Dependencies: Snyk and automated patch management</title><link>https://takao.blog/en/web/security-dependency-vulnerabilities-npm-audit/</link><pubDate>Sat, 15 Nov 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/security-dependency-vulnerabilities-npm-audit/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Auditing NPM Dependencies: Snyk and automated patch management" /&gt;&lt;h2 id="the-supply-chain-problem"&gt;The Supply Chain Problem
&lt;/h2&gt;&lt;p&gt;Modern JavaScript applications ship tens of thousands of transitive dependencies. Each one is a potential attack vector. The &lt;strong&gt;event-stream&lt;/strong&gt; incident (2018), where a malicious package was injected into a popular dependency, demonstrated that vulnerabilities can come from anywhere in the tree. Relying solely on manual review is impossible at this scale.&lt;/p&gt;
&lt;p&gt;Automated tooling is the only practical defense.&lt;/p&gt;
&lt;h2 id="npm-audit"&gt;npm audit
&lt;/h2&gt;&lt;p&gt;The built-in &lt;code&gt;npm audit&lt;/code&gt; command compares your dependency tree against a curated database of known vulnerabilities.&lt;/p&gt;</description></item><item><title>Comparing Package Managers: npm, pnpm, and yarn</title><link>https://takao.blog/en/web/npm-pnpm-yarn-package-managers/</link><pubDate>Tue, 15 Apr 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/npm-pnpm-yarn-package-managers/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post Comparing Package Managers: npm, pnpm, and yarn" /&gt;&lt;h2 id="introduction"&gt;Introduction
&lt;/h2&gt;&lt;p&gt;In JavaScript and Node.js development, package managers are essential daily tools.&lt;/p&gt;
&lt;p&gt;While &lt;strong&gt;npm&lt;/strong&gt; remains the default industry standard, modern alternatives like &lt;strong&gt;pnpm&lt;/strong&gt; (famous for saving disk space and speed) and &lt;strong&gt;yarn&lt;/strong&gt; (featuring zero-installs and Plug&amp;rsquo;n&amp;rsquo;Play modes) offer distinct architectures.&lt;/p&gt;
&lt;p&gt;Although they resolve the same &lt;code&gt;package.json&lt;/code&gt; specifications, their internal storage structures, dependency resolutions, and security features differ. This article compares these three package managers to help you choose the best tool for your next project.&lt;/p&gt;</description></item></channel></rss>