1
0
Fork 0

Remove use of `pify` from the static-server script (#18239)

The static server script no longer uses `pify`. `pify` was being used
to promisify the `fs.stat` function, but that function has a built-in
Promise-supporting API that is now used instead.
This commit is contained in:
Mark Stacey 2023-03-21 15:07:22 -02:30 committed by GitHub
parent 5e3770eb13
commit be63190b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -1,14 +1,13 @@
#!/usr/bin/env node
const fs = require('fs');
const fs = require('fs').promises;
const path = require('path');
const chalk = require('chalk');
const pify = require('pify');
const createStaticServer = require('./create-static-server');
const { parsePort } = require('./lib/parse-port');
const fsStat = pify(fs.stat);
const fsStat = fs.stat;
const DEFAULT_PORT = 9080;
const onResponse = (request, response) => {