nodejs / nodejs/node

node:readline support reading non printable characters such as group separator

オープン
#53,923 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

feature request readline
主要言語
JavaScript
スター
122k
フォーク
37.4k
平均マージ
4日 3時間
マージ済み PR(30日)
272

説明

What is the problem this feature will solve?

When using a USB barcode reader on a TTY app that uses node:readline the group separator character \x1d is needed for GS1-128 barcodes. GS1-128 barcodes contain multiple elements defined by an Application Identifier (AI) that is a 2-4 digit code followed by value. Either a defined length is expected for the data or it looks for the group separator character for early termination of the value.

What is the feature you are proposing to solve the problem?

accept some or all non printable characters as inputs to readline

One of the following

  1. add a flag to turn on that by default is disable to preserve existing implementations
  2. add an option to explicitly define allowable non printable characters, defaults to an empty list
  3. both a global flag and a list
What alternatives have you considered?

I've considered writing my own, seems like a bad idea for support and security. I may look into putting in a PR but I'm starting with a feature request.
I've considered rewriting the application into a non NodeJS application.
I've considered just replacing the TTY app with something more "modern" but there are external layers affecting this decision. This wouldn't allow copy/pasta of other characters which could be useful in some edge cases.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず node:readline の TTY 入力処理と、現在印字不可能な文字をどのように扱っているかを調べます。この issue では、グローバルフラグ、allowlist、またはその両方が提案されているため、contributor はまずこの設計上の選択を解決する必要があります。選択したオプションに対するカバレッジがあり、既存の readline の動作を壊さずにグループ区切り文字を読み取れるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。