本文整理汇总了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,
})
}
}