Node.js 에서 콘솔에 비밀번호 입력 내용 가리기
조회수 1056회
안녕하세요
readline-sync 패키지를 써서 (https://www.npmjs.com/package/readline-sync) 아래 코드로 콘솔에서 비밀번호를 입력하되 이를 *으로 가리고자 합니다만 도무지 알 수 없는 에러가 나옵니다. 도와주세요~
코드:
const readlineSync = require('readline-sync');
const message = 'Please enter password: ';
const options = {
hideEchoBack: true,
mask: '*'
};
const answer = readlineSync.question(message, options);
console.log('Password entered: ', answer);
에러:
C:\Program Files\JetBrains\WebStorm 2018.2.5\bin\runnerw.exe[12932]: src\node_file.cc:1599: Assertion `args[1]->IsInt32()' failed.
1: 00007FF63765ECE5
2: 00007FF637638196
3: 00007FF637638261
4: 00007FF6375FD557
5: 00007FF637E62E52
6: 00007FF637E642ED
7: 00007FF637E63349
8: 00007FF637E6322B
9: 000003AD32F5C5C1
Process finished with exit code 134
참고 :
node 버전 : v10.13.0
readline-sync 버전 : 1.4.9
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력