npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ryome/qr-generator

v1.0.1

Published

テキストファイルの内容からQRコードを生成するCLIツール

Readme

QR Code Generator

概要

テキストファイルの内容をQRコードに変換し、PNG形式で出力するコマンドラインツールです。 カスタムカラーでQRコードを生成することもできます。

インストール方法

グローバルインストール(推奨)

npm install -g @ryome/qr-generator

これにより、qr-generator コマンドがグローバルで使用可能になります。

ローカルインストール

npm install @ryome/qr-generator

この場合は、npx qr-generator として実行する必要があります。

使用方法

基本的な使用方法

qr-generator [オプション] [ファイルパス]

ファイルパスを指定しない場合は、デフォルトで ./qr-text.txt が読み込まれます。

オプション

Options:
  -s, --size <number>      QRコードのサイズ(ピクセル)(デフォルト: 256)
  -e, --error <L|M|Q|H>    エラー訂正レベル (デフォルト: M)
  -m, --margin <number>    マージン(セル単位)(デフォルト: 4)
  -o, --output <path>      出力ファイル名 (デフォルト: qr-output.png)
  -d, --dark <color>       QRコードの暗い部分の色 (デフォルト: #000000)
  -l, --light <color>      QRコードの明るい部分の色 (デフォルト: #ffffff)
  -h, --help              ヘルプを表示

使用例

# 基本的な使用方法(デフォルトのファイルを使用)
qr-generator

# 特定のファイルを指定
qr-generator path/to/input.txt

# サイズとエラー訂正レベルを指定
qr-generator -s 400 -e H input.txt

# 出力ファイル名を指定
qr-generator -o custom-qr.png input.txt

# QRコードの色を指定(赤色のQRコード)
qr-generator -d "#FF0000" -l "#FFFFFF" input.txt

# すべてのオプションを指定
qr-generator -s 400 -e H -m 2 -d "#000080" -l "#FFFFCC" -o custom-qr.png input.txt

# npxを使用する場合(ローカルインストール時)
npx qr-generator -s 400 input.txt

必要要件

  • Node.js 14.0.0以上

トラブルシューティング

エラーコードと対処方法

E0001: FILE_NOT_FOUND

入力ファイルが見つからない場合に発生します。

Error [E0001]: Input file not found: ./input.txt
詳細: 指定されたパスにファイルが存在しません

対処方法:

  • ファイルパスが正しいか確認
  • ファイルが存在するか確認
  • 相対パスの場合、実行時のカレントディレクトリを確認

E0002: FILE_READ_ERROR

ファイルの読み込みに失敗した場合に発生します。

Error [E0002]: Failed to read file: ./input.txt
詳細: ファイルの読み込み権限がないか、ファイルがロックされています

対処方法:

  • ファイルの権限設定を確認
  • ファイルが他のプロセスによってロックされていないか確認
  • ファイルが破損していないか確認

E0003: INVALID_OPTION

不正なオプション値が指定された場合に発生します。

Error [E0003]: Invalid error correction level: X (must be L, M, Q, or H)
詳細: エラー訂正レベルは L, M, Q, H のいずれかを指定してください

対処方法:

  • サイズは128-1024の範囲内の正の整数を指定
  • エラー訂正レベルは L, M, Q, H のいずれかを指定
  • マージンは0-10の範囲内の正の整数を指定

E0004: WRITE_ERROR

出力ファイルの書き込みに失敗した場合に発生します。

Error [E0004]: Failed to write output file: ./qr-output.png
詳細: 出力先のディレクトリに書き込み権限がないか、ディスク容量が不足しています

対処方法:

  • 出力先ディレクトリの書き込み権限を確認
  • ディスク容量が十分か確認
  • 出力ファイルが他のプロセスによってロックされていないか確認

E0005: INVALID_COLOR

不正な色指定の場合に発生します。

Error [E0005]: Invalid color format: invalid-color (must be #RRGGBB format)
詳細: カラーコードは #RRGGBB 形式で指定してください(例: #FF0000)

対処方法:

  • カラーコードは#で始まる6桁の16進数で指定
  • 大文字小文字は区別しない(#ff0000も#FF0000も有効)
  • 3桁の短縮形式は使用不可(#FFFは無効)

ライセンス

MIT License - 詳細はLICENSEファイルを参照してください。

作者

ryome

バグ報告

バグを見つけた場合は、GitHub Issuesに報告してください。