Last active
September 27, 2022 19:43
-
-
Save antklim/2a8016ae0b6260279e6b2e518fc8ace1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { readFile } from 'node:fs'; | |
| const readFileCallback = (err: Error | null, data: string | Buffer) => { | |
| if (err) { | |
| console.log(err); | |
| return; | |
| } | |
| // process data ... | |
| console.log(data.length); | |
| } | |
| const main = () => { | |
| readFile('/tmp/data', readFileCallback); | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment