Skip to the content Skip to the main menu

Time is Life!

Make your life fun and creative!!

  • Sitemap
A freelance web engineer. A dad for two kids :)
Be simple and practical!

Follow me on Twitter.

  • Partial Keyframes
    2025-06-10
  • The Height Enigma
    2025-05-12
  • The Post-Developer Era
    2025-04-14
  • A Million Little Secrets
    2025-02-24
  • Container Queries Unleashed
    2025-01-27
  • Next-level frosted glass with backdrop-filter
    2024-12-02
  • A Framework for Evaluating Browser Support
    2024-11-26
  • A Friendly Introduction to Container Queries
    2024-11-04
  • How I Built My Blog
    2024-09-24
  • The Undeniable Utility Of CSS :has
    2024-09-09

RSS Cointelegraph

  • Here’s what happened in crypto today 2025-06-26
  • 3 reasons why Bitcoin price could fall below $100,000 2025-06-26
  • Banking Committee chair sets September goal for market structure bill 2025-06-26
  • Bitwise adds in-kind redemptions to DOGE, APT ETF filings 2025-06-26
  • Meta hires former OpenAI top talent amid AGI push 2025-06-26

RSS CoinPost

  • WiFi共有のDePin系プロジェクト「Roam」、ソラナブロックチェーンに移行 2024-04-01
  • イーサリアムの分散化促進などを期待 ヴィタリック、開発計画「パージ」を説明 2024-04-01
  • Farcaster開発企業、パラダイム主導のラウンドで「ユニコーン」に 2024-04-01
  • コインベースがArkham新規上場、廃止銘柄も 2024-04-01
  • テザー社、ビットコイン保有が7800億円超え 2024-04-01

RSS CSS-Tricks

  • KelpUI 2025-06-26
  • Poking at the CSS if() Function a Little More: Conditional Color Theming 2025-06-25
  • Lightly Poking at the CSS if() Function in Chrome 137 2025-06-24
  • A Better API for the Intersection and Mutation Observers 2025-06-23
  • Color Everything in CSS 2025-06-20

RSS Coliss

  • HTMLの仕様が変更され、属性値内に記述した<と>がエスケープされるようになります 2025-06-26
  • 本日(6/25)限り、国産ノーコードツール「Studio」の解説書「Studio Webサイト制作入門」が80%オフのワンコイン! 2025-06-25
  • 商用利用OKの無料版と有料版が同時リリース! 万年筆で一文字ずつ手書きされた、やさしい雰囲気のフォント「ノエリーフ」 2025-06-24
  • セール初登場もたくさん! 年に一度のKindle本プライムデーセールが開催、Web制作・デザイン・イラストの良書が最安値です 2025-06-23
  • こういうデザイン書が欲しかった! 日本語フォントを使用したデザインの知識と実践テクニックが基礎から学べる解説書 -怖くないタイポグラフィ 2025-06-20

カテゴリー

  • AWS (4)
  • CircleCI (1)
  • CSS (2)
  • Docker (2)
  • GCP (2)
  • GraphQL (2)
  • i18n (2)
  • JavaScript (15)
  • Next.js (4)
  • Node.js (1)
  • Nuxt.js (10)
  • React (10)
  • Sass (2)
  • Storybook (1)
  • tailwindcss (1)
  • TypeScript (18)
  • Web Tech (2)
  • 転職 (2)

Make your life fun and creative!!

  • Sitemap
A freelance web engineer. A dad for two kids :)
Be simple and practical!

Follow me on Twitter.

  • Partial Keyframes
    2025-06-10
  • The Height Enigma
    2025-05-12
  • The Post-Developer Era
    2025-04-14
  • A Million Little Secrets
    2025-02-24
  • Container Queries Unleashed
    2025-01-27
  • Next-level frosted glass with backdrop-filter
    2024-12-02
  • A Framework for Evaluating Browser Support
    2024-11-26
  • A Friendly Introduction to Container Queries
    2024-11-04
  • How I Built My Blog
    2024-09-24
  • The Undeniable Utility Of CSS :has
    2024-09-09

RSS Cointelegraph

  • Here’s what happened in crypto today 2025-06-26
  • 3 reasons why Bitcoin price could fall below $100,000 2025-06-26
  • Banking Committee chair sets September goal for market structure bill 2025-06-26
  • Bitwise adds in-kind redemptions to DOGE, APT ETF filings 2025-06-26
  • Meta hires former OpenAI top talent amid AGI push 2025-06-26

RSS CoinPost

  • WiFi共有のDePin系プロジェクト「Roam」、ソラナブロックチェーンに移行 2024-04-01
  • イーサリアムの分散化促進などを期待 ヴィタリック、開発計画「パージ」を説明 2024-04-01
  • Farcaster開発企業、パラダイム主導のラウンドで「ユニコーン」に 2024-04-01
  • コインベースがArkham新規上場、廃止銘柄も 2024-04-01
  • テザー社、ビットコイン保有が7800億円超え 2024-04-01

RSS CSS-Tricks

  • KelpUI 2025-06-26
  • Poking at the CSS if() Function a Little More: Conditional Color Theming 2025-06-25
  • Lightly Poking at the CSS if() Function in Chrome 137 2025-06-24
  • A Better API for the Intersection and Mutation Observers 2025-06-23
  • Color Everything in CSS 2025-06-20

RSS Coliss

  • HTMLの仕様が変更され、属性値内に記述した<と>がエスケープされるようになります 2025-06-26
  • 本日(6/25)限り、国産ノーコードツール「Studio」の解説書「Studio Webサイト制作入門」が80%オフのワンコイン! 2025-06-25
  • 商用利用OKの無料版と有料版が同時リリース! 万年筆で一文字ずつ手書きされた、やさしい雰囲気のフォント「ノエリーフ」 2025-06-24
  • セール初登場もたくさん! 年に一度のKindle本プライムデーセールが開催、Web制作・デザイン・イラストの良書が最安値です 2025-06-23
  • こういうデザイン書が欲しかった! 日本語フォントを使用したデザインの知識と実践テクニックが基礎から学べる解説書 -怖くないタイポグラフィ 2025-06-20

カテゴリー

  • AWS (4)
  • CircleCI (1)
  • CSS (2)
  • Docker (2)
  • GCP (2)
  • GraphQL (2)
  • i18n (2)
  • JavaScript (15)
  • Next.js (4)
  • Node.js (1)
  • Nuxt.js (10)
  • React (10)
  • Sass (2)
  • Storybook (1)
  • tailwindcss (1)
  • TypeScript (18)
  • Web Tech (2)
  • 転職 (2)

Using package.json as a module in TypeScript

If you want to get a value like the version info from package.json, this is what to do.

Add resolveJsonModule config to tsconfig.json.

{
  "compilerOptions": {
    "target": "es5",
    ...
    "resolveJsonModule": true
  }
}

Import package.json in your ts file.

import { version } from 'package.json';
  • Post date
    2021-03-31
  • Posted in JavaScript, TypeScript
Previous post: Next.js with PostCSS 100vh Fix Next post: How to seed data into Mongo with Docker

Related Posts

React: MUI toast context

  • Posted in JavaScript, React, TypeScript

Frontend 知ってて便利なツールやサイトの紹介

  • Posted in AWS, GCP, JavaScript

Applying the full color palette of Tailwind CSS

  • Posted in JavaScript, Sass, tailwindcss

Axios cancelToken instead of debounce funtion

  • Posted in JavaScript, React

Follow me on Twitter.