Skip to content

Instantly share code, notes, and snippets.

@beardlessman
Created June 4, 2019 01:22
Show Gist options
  • Save beardlessman/eec817b21cdf6d27d2ddd2992050cb8c to your computer and use it in GitHub Desktop.
Save beardlessman/eec817b21cdf6d27d2ddd2992050cb8c to your computer and use it in GitHub Desktop.
.toString() энкодит utf-8?
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