2022-05-21から1日間の記事一覧

Node.jsでパッケージが参照しているnode_modulesのパスを取得する

結論 環境 動作確認 CommonJSの場合 ES Modulesの場合 参考ドキュメント まとめ 結論 require.resolveを使う Use the internal require() machinery to look up the location of a module, but rather than loading the module, just return the resolved fi…