Created
June 4, 2019 01:22
-
-
Save beardlessman/eec817b21cdf6d27d2ddd2992050cb8c to your computer and use it in GitHub Desktop.
.toString() энкодит utf-8?
This file contains 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
import fs from 'fs'; | |
const print1 = path => { | |
fs.readFile(path, (err, content) => console.log(content.toString())); | |
} | |
const print2 = path => fs.readFile( | |
path, | |
'utf-8', | |
(error, data) => console.log(data), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment