本文整理匯總了TypeScript中fs-extra-p.readFileSync函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript readFileSync函數的具體用法?TypeScript readFileSync怎麽用?TypeScript readFileSync使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了readFileSync函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: readFileSync
.map(it => {
const name = it.substring(resourceDir.length + 1)
if (it.endsWith("package.json")) {
return {name, content: readFileSync(it, "utf-8")}
}
return name
})
示例2: resolve
child.on("close", (code: number) => {
if (code === 0) {
resolve()
}
else {
try {
console.error(readFileSync(path.join(testPackageDir, "npm-debug.log"), "utf8"))
}
catch (e) {
// ignore
}
reject(new Error(`${command} ${args.join(" ")} exited with code ${code}`))
}
})
示例3: callback
child.on("close", (code: number) => {
if (code === 0) {
callback()
}
else {
console.error(`${command} ${args.join(" ")} exited with code ${code}`)
if (command === "npm") {
try {
console.error(fs.readFileSync(path.join(testPackageDir, "npm-debug.log"), "utf8"))
}
catch (e) {
// ignore
}
}
process.exit(1)
}
})