프로그래밍/개발메모
-
node.js 비동기 모듈 작업프로그래밍/개발메모 2020. 5. 14. 13:38
/* 1. start 2. end 3. abc_async 순으로 동작하도록 짜려고함 */ var mymodule = require('./mymodule'); console.log("start"); mymodule.abc_async(); console.log("end"); 모듈쪽내용 /* mymodule.js 내용 */ async function abc_async() { console.log("abc_async start"); await sleep(1000); console.log("abc_async end"); } const sleep = async (ms) => { return new Promise(resolve=>{ setTimeout(resolve,ms) }) } module.exports.abc_..
-
윈도우즈 커맨드 결과를 변수에 넣기프로그래밍/개발메모 2020. 2. 21. 00:15
출처: https://stackoverflow.com/questions/6359820/how-to-set-commands-output-as-a-variable-in-a-batch-file 자동화 때문에 결과를 보관하고 연산하고 해야해서 찾아봤습니다. FOR /F "tokens=* USEBACKQ" %%F IN (`커맨드`) DO (SET var=%%F)echo %var%커맨드 부분에 쓸내용을 쓰고 (예를 들어 time /T 같은거)커맨드가 끝날때 까지 var 에 내용이 들어갑니다.