Created
November 16, 2016 00:19
-
-
Save dstyle0210/19736110701f0ed1a7c6b5f82b0fde1c to your computer and use it in GitHub Desktop.
[node] 폴더가 없어서 fs.writeFileSync 가 안될때 처리법.(node로 폴더 생성하기)
This file contains hidden or 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
| try{ | |
| fs.mkdirSync('생성할폴더명(경로로 지정도 가능)'); | |
| }catch(e){ | |
| if ( e.code != 'EEXIST' ) throw e; // 존재할경우 패스처리함. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment