更新: | 2024-05-20 |
---|---|
作者: | @voluntas |
バージョン: | 2024.1 |
URL: | https://voluntas.github.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const textarea = document.querySelector('textarea[data-id="root"]'); | |
textarea?.addEventListener( | |
"keydown", | |
(event) => { | |
if (event.key === "Enter" && event.isComposing) { | |
event.stopPropagation(); | |
} | |
}, | |
{ capture: true } | |
); |
node.js でパスを取得する方法についてのメモ
$ node ~/hoge/Foo.js/a.js
を実行したときに、
process.argv[1]
から、node コマンドに指定された a.js のパス(~/hoge/Foo.js/a.js
)を取得できます