Skip to content

Instantly share code, notes, and snippets.

@sorie
Last active March 12, 2020 12:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorie/ba510eee210c3f160b61 to your computer and use it in GitHub Desktop.
Save sorie/ba510eee210c3f160b61 to your computer and use it in GitHub Desktop.
node.js-FileSystem 모듈사용하여 파일 읽기
//Node.js - File System 모듈 호출
// 참고 URL: http://nodejs.org/api/fs.html
var fs = require('fs');
console.log('파일읽기프로세스시작...');
fs.readFile('files/user.json', function (err, data) {
var jsonobj = JSON.parse(data);
console.log('data:' + jsonobj.nickname);
});
console.log('파일읽기프로세스끝.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment