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.

  • 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
  • Promises From The Ground Up
    2024-06-03

RSS Cointelegraph

  • Here’s what happened in crypto today 2025-05-31
  • Bitcoin advocate Max keiser casts doubt over new BTC treasury companies 2025-05-31
  • SEC says REX-Osprey staked SOL and ETH funds may not qualify as ETFs 2025-05-31
  • Bitcoin analysts predict $180K to $250K price top in 2025 — Which is most realistic? 2025-05-31
  • BitMEX uncovers holes in Lazarus Group's operational security 2025-05-31

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

  • Better CSS Shapes Using shape() — Part 2: More on Arcs 2025-05-30
  • What We Know (So Far) About CSS Reading Order 2025-05-27
  • Better CSS Shapes Using shape() — Part 1: Lines and Arcs 2025-05-23
  • You can style alt text like any other text 2025-05-22
  • SVG to CSS Shape Converter 2025-05-21

RSS Coliss

  • 読むとワクワクする! 最近見かけるHTMLとCSSのさまざまな実装テクニックがまとめられた解説書 -改訂新版 HTML&CSSデザインレシピ集 2025-05-30
  • これは朗報! ついにCSSでif else文が使えるようになります、Chrome 137で新しく追加された7個のCSSの機能 2025-05-29
  • 2025年、現在の環境に適したリセットCSSのまとめ 2025-05-28
  • Pocketが終了するので、代替として無料で利用できるブックマーク管理ツールのRaindrop.ioに移行した手順 2025-05-27
  • 商用でも完全に無料! UIデザイン用にシンプルなラインでデザインされたSVGアイコン素材 -Lineicons 2025-05-26

カテゴリー

  • 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.

  • 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
  • Promises From The Ground Up
    2024-06-03

RSS Cointelegraph

  • Here’s what happened in crypto today 2025-05-31
  • Bitcoin advocate Max keiser casts doubt over new BTC treasury companies 2025-05-31
  • SEC says REX-Osprey staked SOL and ETH funds may not qualify as ETFs 2025-05-31
  • Bitcoin analysts predict $180K to $250K price top in 2025 — Which is most realistic? 2025-05-31
  • BitMEX uncovers holes in Lazarus Group's operational security 2025-05-31

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

  • Better CSS Shapes Using shape() — Part 2: More on Arcs 2025-05-30
  • What We Know (So Far) About CSS Reading Order 2025-05-27
  • Better CSS Shapes Using shape() — Part 1: Lines and Arcs 2025-05-23
  • You can style alt text like any other text 2025-05-22
  • SVG to CSS Shape Converter 2025-05-21

RSS Coliss

  • 読むとワクワクする! 最近見かけるHTMLとCSSのさまざまな実装テクニックがまとめられた解説書 -改訂新版 HTML&CSSデザインレシピ集 2025-05-30
  • これは朗報! ついにCSSでif else文が使えるようになります、Chrome 137で新しく追加された7個のCSSの機能 2025-05-29
  • 2025年、現在の環境に適したリセットCSSのまとめ 2025-05-28
  • Pocketが終了するので、代替として無料で利用できるブックマーク管理ツールのRaindrop.ioに移行した手順 2025-05-27
  • 商用でも完全に無料! UIデザイン用にシンプルなラインでデザインされたSVGアイコン素材 -Lineicons 2025-05-26

カテゴリー

  • 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 (TypeScript): Blob/File to base64 using FileReader.readAsDataURL()

  • Posted in React, TypeScript

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

  • Posted in Nuxt.js, TypeScript

Conquer Complex Data: How to Realize Table Joins with Prisma

  • Posted in Next.js, TypeScript

JavascriptでCSS (Sass) プロパティを利用する

  • Posted in JavaScript, Sass

Follow me on Twitter.