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!
  • An Interactive Guide to SVG Paths
    2025-08-18
  • A Friendly Introduction to SVG
    2025-07-21
  • 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

RSS Cointelegraph

  • Saylor signals third consecutive Strategy Bitcoin buy in August 2025-08-24
  • Bitcoin whales swap BTC for Ether as trader sees ETH at $5.5K next 2025-08-24
  • One year since Durov’s arrest: What’s happened and what’s ahead? 2025-08-24
  • The future of crypto in the Asia-Middle East corridor lies in permissioned scale 2025-08-24
  • Here’s what happened in crypto today 2025-08-24

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

  • 3D Layered Text: Interactivity and Dynamicism 2025-08-22
  • 3D Layered Text: Motion and Variations 2025-08-20
  • 3D Layered Text: The Basics 2025-08-18
  • Covering hidden=until-found 2025-08-15
  • A Few Things About the Anchor Element’s href You Might Not Have Known 2025-08-15

RSS Coliss

  • Kindle本 季節先取りセールが開催! セール初登場もあり、Web制作やUIデザイン、イラスト書がかなりお買い得です 2025-08-22
  • UI要素のサイズ、マージン、角丸、フォントサイズに至るまで、すべてが黄金比に基づいて設計されたUIフレームワーク -LiftKit 2025-08-21
  • かわいすぎる絵文字フォント! 英字や数字が文鳥、豆苗、鳴き声でぎゅうぎゅうに表示されるフリーフォント「ぎゅうぎゅう文鳥」 2025-08-20
  • SBクリエイティブKindle本のビッグサマーセールが開催! 創作に役立つ資料や辞典がお買い得です 2025-08-19
  • Kindle本サマーセール 第2弾が開催! セール初登場もたくさんあり、Web制作やUIデザイン、イラスト書がかなりお買い得です 2025-08-18

カテゴリー

  • 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!
  • An Interactive Guide to SVG Paths
    2025-08-18
  • A Friendly Introduction to SVG
    2025-07-21
  • 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

RSS Cointelegraph

  • Saylor signals third consecutive Strategy Bitcoin buy in August 2025-08-24
  • Bitcoin whales swap BTC for Ether as trader sees ETH at $5.5K next 2025-08-24
  • One year since Durov’s arrest: What’s happened and what’s ahead? 2025-08-24
  • The future of crypto in the Asia-Middle East corridor lies in permissioned scale 2025-08-24
  • Here’s what happened in crypto today 2025-08-24

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

  • 3D Layered Text: Interactivity and Dynamicism 2025-08-22
  • 3D Layered Text: Motion and Variations 2025-08-20
  • 3D Layered Text: The Basics 2025-08-18
  • Covering hidden=until-found 2025-08-15
  • A Few Things About the Anchor Element’s href You Might Not Have Known 2025-08-15

RSS Coliss

  • Kindle本 季節先取りセールが開催! セール初登場もあり、Web制作やUIデザイン、イラスト書がかなりお買い得です 2025-08-22
  • UI要素のサイズ、マージン、角丸、フォントサイズに至るまで、すべてが黄金比に基づいて設計されたUIフレームワーク -LiftKit 2025-08-21
  • かわいすぎる絵文字フォント! 英字や数字が文鳥、豆苗、鳴き声でぎゅうぎゅうに表示されるフリーフォント「ぎゅうぎゅう文鳥」 2025-08-20
  • SBクリエイティブKindle本のビッグサマーセールが開催! 創作に役立つ資料や辞典がお買い得です 2025-08-19
  • Kindle本サマーセール 第2弾が開催! セール初登場もたくさんあり、Web制作やUIデザイン、イラスト書がかなりお買い得です 2025-08-18

カテゴリー

  • 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: IntersectionObserver hook (TypeScript)

  • Posted in JavaScript, React, TypeScript

Nuxt.js: Google Tag Manager & Google Analytics with @nuxtjs/gtm

  • Posted in Nuxt.js, TypeScript

AWS AmplifyでReactアプリケーション (TypeScript & GraphQL)

  • Posted in AWS, GraphQL, React, TypeScript

Performance check with console.time()

  • Posted in JavaScript

Follow me on Twitter.