Skip to content

Instantly share code, notes, and snippets.

@dstyle0210
Created November 16, 2016 00:19
Show Gist options
  • Select an option

  • Save dstyle0210/19736110701f0ed1a7c6b5f82b0fde1c to your computer and use it in GitHub Desktop.

Select an option

Save dstyle0210/19736110701f0ed1a7c6b5f82b0fde1c to your computer and use it in GitHub Desktop.
[node] 폴더가 없어서 fs.writeFileSync 가 안될때 처리법.(node로 폴더 생성하기)
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