Answers for "import fs in typescript"

0

import fs in typescript

import * as fs from 'fs';
import * as path from 'path';
fs.readFile(path.join(__dirname, '../../client/index.html'), 'utf8', (error, data) => {
        // ...
    })

in the package.json file:
"dependencies": {
 "@types/node": "^7.0.5"
}

in the tsconfig.json:
"typeRoots": [
            "./node_modules/@types"
        ]
Posted by: Guest on October-25-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language