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 path from 'node:path'; | |
| import fs from 'node:fs'; | |
| import http from 'node:http'; | |
| const HTTP_PORT = 3000; | |
| const STATIC_DIR = path.join(process.cwd(), './static'); | |
| const fsExists = (filePath) => fs.promises.access(filePath).then(() => true, () => false); |
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
| const path = require('node:path'); | |
| const fs = require('node:fs'); | |
| const assert = require('node:assert'); | |
| const requireImpl = (pth) => { | |
| assert((typeof pth) === 'string'); | |
| let moduleText; | |
| const modulePath = path.join(process.cwd(), pth); | |
| try { | |
| moduleText = fs.readFileSync(modulePath); |
OlderNewer