Skip to content

Commit

Permalink
feat(add): node simple demo
Browse files Browse the repository at this point in the history
  • Loading branch information
seognil committed May 26, 2020
1 parent 9867003 commit 60c481a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions node/simple-demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const path = require('path');
const { readFile } = require('fs');
const { promisify } = require('util');

const asyncReadFile = promisify(readFile);

const srcFile = path.resolve(__dirname, 'text/hello.md');

(async () => {
const txt = await asyncReadFile(srcFile, 'utf8');
console.log('path is:', srcFile);
console.log('context:', txt);
})();
1 change: 1 addition & 0 deletions node/simple-demo/text/hello.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World!

0 comments on commit 60c481a

Please sign in to comment.