nodejs / nodejs/node

Make `--print` respect --input-type=module

オープン
#58,994 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

feature request never-stale
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

What is the problem this feature will solve?

This doesn't work, but it should:

node -p 'await Promise.resolve(123)' --input-type=module

Related to https://github.com/nodejs/node/issues/45924#issuecomment-2751207324 - but that was about --print and --eval. It seems to be fixed for --eval but not for --print

Note: bun -p 'await Promise.resolve(123)' works

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

Make a similar change to whatever fixed #45924

What alternatives have you considered?

bun

Note: node -e 'console.log(await Promise.resolve(123))' --input-type=module does work, but it's not always possible to use a console.log, especially when using node -p in a piped bash expression

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

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

はじめの一歩

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

調査の方向性

node -p 'await Promise.resolve(123)' --input-type=module で問題を再現し、issue #45924 で --eval の経路がどのように変更されたかを比較してください。--print--input-type=module のコマンドライン処理を追跡してください。例が期待どおりの出力結果で正常に評価されれば完了です。

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

評価

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

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

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