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

RSS Cointelegraph

  • ETH bounces off $1.8K as multiple Ether price metrics point to prolonged weakness 2026-02-24
  • ESMA warns crypto perpetual derivatives likely fall under CFD rules 2026-02-24
  • Coinbase opens stock and ETF trading to all US users in multi-asset push 2026-02-24
  • Kraken debuts tokenized stock perpetual futures for non-US traders 2026-02-24
  • MoonPay launches ‘Agents,’ giving AI systems wallets and onchain cash flow 2026-02-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

  • Loading Smarter: SVG vs. Raster Loaders in Modern Web Design 2026-02-23
  • Potentially Coming to a Browser :near() You 2026-02-20
  • Distinguishing “Components” and “Utilities” in Tailwind 2026-02-18
  • Spiral Scrollytelling in CSS With sibling-index() 2026-02-17
  • Interop 2026 2026-02-17

RSS Coliss

  • これ1つでOK! CSSでLiquid GlassやGlassmorphism、Nuemorphismを実装できる便利ツール -Aether CSS 2026-02-24
  • さらに便利で使いやすくなった! 最新のCanvaに対応、プロユースでも使えるデザインのテクニックまでよく分かる解説書 -Canva使い方入門 増補改訂版 2026-02-20
  • ブックマークしておくと便利! さまざまなデバイスのスクリーンサイズ・解像度・ピクセル密度などの仕様が一覧できる -What Is My Screen Size? 2026-02-19
  • 筆文字の新作日本語フリーフォントがリリース! 凛とした佇まいが美しい、気高い雰囲気を持ったフォント「藍原筆文字 凜華」 2026-02-18
  • このホバーエフェクト、楽しい! CSSのみで実装する、弓の弦のように弾けるホバーエフェクト(方向も認識) 2026-02-17

カテゴリー

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

RSS Cointelegraph

  • ETH bounces off $1.8K as multiple Ether price metrics point to prolonged weakness 2026-02-24
  • ESMA warns crypto perpetual derivatives likely fall under CFD rules 2026-02-24
  • Coinbase opens stock and ETF trading to all US users in multi-asset push 2026-02-24
  • Kraken debuts tokenized stock perpetual futures for non-US traders 2026-02-24
  • MoonPay launches ‘Agents,’ giving AI systems wallets and onchain cash flow 2026-02-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

  • Loading Smarter: SVG vs. Raster Loaders in Modern Web Design 2026-02-23
  • Potentially Coming to a Browser :near() You 2026-02-20
  • Distinguishing “Components” and “Utilities” in Tailwind 2026-02-18
  • Spiral Scrollytelling in CSS With sibling-index() 2026-02-17
  • Interop 2026 2026-02-17

RSS Coliss

  • これ1つでOK! CSSでLiquid GlassやGlassmorphism、Nuemorphismを実装できる便利ツール -Aether CSS 2026-02-24
  • さらに便利で使いやすくなった! 最新のCanvaに対応、プロユースでも使えるデザインのテクニックまでよく分かる解説書 -Canva使い方入門 増補改訂版 2026-02-20
  • ブックマークしておくと便利! さまざまなデバイスのスクリーンサイズ・解像度・ピクセル密度などの仕様が一覧できる -What Is My Screen Size? 2026-02-19
  • 筆文字の新作日本語フリーフォントがリリース! 凛とした佇まいが美しい、気高い雰囲気を持ったフォント「藍原筆文字 凜華」 2026-02-18
  • このホバーエフェクト、楽しい! CSSのみで実装する、弓の弦のように弾けるホバーエフェクト(方向も認識) 2026-02-17

カテゴリー

  • 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

Tweets on web tools

  • Posted in JavaScript, Web Tech

Nuxt.js: Auto-complete search with Google Maps API (TypeScript)

  • Posted in GCP, Nuxt.js, TypeScript

Nuxt.js: VeeValidateでバリデーション (TypeScript)

  • Posted in Nuxt.js, TypeScript

JavaScript: async/await をループ処理で使いたい -> Promise.all()でOK!

  • Posted in JavaScript

Follow me on Twitter.