Icard/angular-clarity-master(work.../node_modules/@npmcli/run-script/lib/is-server-package.js

13 lines
314 B
JavaScript
Raw Normal View History

2024-07-16 14:55:36 +00:00
const util = require('util')
const fs = require('fs')
const { stat } = fs.promises || { stat: util.promisify(fs.stat) }
const { resolve } = require('path')
module.exports = async path => {
try {
const st = await stat(resolve(path, 'server.js'))
return st.isFile()
} catch (er) {
return false
}
}