本文整理匯總了TypeScript中fs-extra-p.outputJson函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript outputJson函數的具體用法?TypeScript outputJson怎麽用?TypeScript outputJson使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了outputJson函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: outputJson
tempDirCreated: projectDir => BluebirdPromise.all([
outputJson(path.join(projectDir, "node_modules", "electron-prebuilt", "package.json"), {
version: "0.37.8"
}),
modifyPackageJson(projectDir, data => {
data.devDependencies = {}
})
])
示例2: outputJson
projectDirCreated: projectDir => BluebirdPromise.all([
outputJson(path.join(projectDir, "node_modules", "electron-prebuilt", "package.json"), {
version: ELECTRON_VERSION
}),
modifyPackageJson(projectDir, data => {
delete data.build.electronVersion
data.devDependencies = {}
})
])
示例3: writeOldMacInfo
// backward compatibility - write json file
async function writeOldMacInfo(publishConfig: PublishConfiguration, outDir: string, dir: string, channel: string, createdFiles: Set<string>, version: string, packager: PlatformPackager<any>) {
const isGitHub = publishConfig.provider === "github"
const updateInfoFile = (isGitHub && outDir === dir) ? path.join(dir, "github", `${channel}-mac.json`) : path.join(dir, `${channel}-mac.json`)
if (!createdFiles.has(updateInfoFile)) {
createdFiles.add(updateInfoFile)
await outputJson(updateInfoFile, {
version,
releaseDate: new Date().toISOString(),
url: computeDownloadUrl(publishConfig, packager.generateName2("zip", "mac", isGitHub), packager),
}, {spaces: 2})
packager.info.dispatchArtifactCreated({
file: updateInfoFile,
arch: null,
packager,
target: null,
publishConfig,
})
}
}