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!
  • Getting Started with Anchor Positioning
    2026-07-06
  • CSS vs. JavaScript
    2026-05-26
  • Scroll-Driven Animations
    2026-04-28
  • Squash and Stretch
    2026-04-13
  • Sneaky Header Blocker Trick
    2026-03-23
  • Sprites on the Web
    2026-02-23
  • Brand New Layouts with CSS Subgrid
    2025-11-25
  • Springs and Bounces in Native CSS
    2025-10-28
  • The Big Gotcha With @starting-style
    2025-09-22
  • Color Shifting in CSS
    2025-09-08

RSS Cointelegraph

  • Domestic stablecoins could boost demand for dollar-backed tokens: IMF 2026-08-08
  • US court backs Bybit’s bid to trace funds from $1.5B North Korea hack 2026-08-08
  • Donald Trump’s media company to terminate Crypto.com deal 2026-08-07
  • US Treasury’s OFAC sanctions 2 Iran-linked crypto exchanges 2026-08-07
  • Here’s what happened in crypto today 2026-08-07

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

  • Using and Styling the Dialog Element 2026-08-07
  • 2026 State of CSS, Devs Surveys 2026-08-06
  • Gap Decorations Are Now Available, Here’s What’s New 2026-08-03
  • Get Ready For the Powerful CSS border-shape Property! 2026-07-31
  • What’s !important #16: sibling-index() Animations, Use Cases for the infinity Keyword, Container Stuck Queries, and More 2026-07-31

RSS Coliss

  • まさに仕事で使えるAI解説書の決定版! Gemini Notebook(NotebookLM)が使いこなせるようになる -AI仕事最速大全 2026-08-07
  • CSSの進化がすごい! JavaScriptなしで、遷移元と遷移先で異なる挙動を実現するルートとナビゲーションの連携機能 2026-08-06
  • 最近のデバイスに対応したブレイクポイントがすぐに分かる! レスポンシブを設計する際に役立つツール -ScreenSize.net 2026-08-05
  • Web制作者は要チェック! カメラにアクセスできるusermedia要素など、Chrome 151で追加された6個の新機能 2026-08-04
  • 祝3周年で30フォント! 213ちゃんから日本語の新作フリーフォントがリリース、パラパラ感がかわいいフォント「ひとりっこ」 2026-08-03

カテゴリー

  • 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!
  • Getting Started with Anchor Positioning
    2026-07-06
  • CSS vs. JavaScript
    2026-05-26
  • Scroll-Driven Animations
    2026-04-28
  • Squash and Stretch
    2026-04-13
  • Sneaky Header Blocker Trick
    2026-03-23
  • Sprites on the Web
    2026-02-23
  • Brand New Layouts with CSS Subgrid
    2025-11-25
  • Springs and Bounces in Native CSS
    2025-10-28
  • The Big Gotcha With @starting-style
    2025-09-22
  • Color Shifting in CSS
    2025-09-08

RSS Cointelegraph

  • Domestic stablecoins could boost demand for dollar-backed tokens: IMF 2026-08-08
  • US court backs Bybit’s bid to trace funds from $1.5B North Korea hack 2026-08-08
  • Donald Trump’s media company to terminate Crypto.com deal 2026-08-07
  • US Treasury’s OFAC sanctions 2 Iran-linked crypto exchanges 2026-08-07
  • Here’s what happened in crypto today 2026-08-07

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

  • Using and Styling the Dialog Element 2026-08-07
  • 2026 State of CSS, Devs Surveys 2026-08-06
  • Gap Decorations Are Now Available, Here’s What’s New 2026-08-03
  • Get Ready For the Powerful CSS border-shape Property! 2026-07-31
  • What’s !important #16: sibling-index() Animations, Use Cases for the infinity Keyword, Container Stuck Queries, and More 2026-07-31

RSS Coliss

  • まさに仕事で使えるAI解説書の決定版! Gemini Notebook(NotebookLM)が使いこなせるようになる -AI仕事最速大全 2026-08-07
  • CSSの進化がすごい! JavaScriptなしで、遷移元と遷移先で異なる挙動を実現するルートとナビゲーションの連携機能 2026-08-06
  • 最近のデバイスに対応したブレイクポイントがすぐに分かる! レスポンシブを設計する際に役立つツール -ScreenSize.net 2026-08-05
  • Web制作者は要チェック! カメラにアクセスできるusermedia要素など、Chrome 151で追加された6個の新機能 2026-08-04
  • 祝3周年で30フォント! 213ちゃんから日本語の新作フリーフォントがリリース、パラパラ感がかわいいフォント「ひとりっこ」 2026-08-03

カテゴリー

  • 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

Nuxt.js: Font Awesomeの導入(TypeScript)

  • Posted in Nuxt.js, TypeScript

React: IntersectionObserver hook (TypeScript)

  • Posted in JavaScript, React, TypeScript

AWS Amplify: Auth関連まとめ

  • Posted in AWS, GraphQL, React, TypeScript

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

  • Posted in AWS, GCP, JavaScript

Follow me on Twitter.