本文整理匯總了TypeScript中fs-promise.remove函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript remove函數的具體用法?TypeScript remove怎麽用?TypeScript remove使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了remove函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
async function test() {
await fs.copy(src, dst);
await fs.emptyDir(dir);
await fs.emptydir(dir);
await fs.ensureFile(path);
await fs.createFile(path);
await fs.ensureDir(dir);
await fs.ensureLink(src, dst);
await fs.createLink(src, dst);
await fs.ensureSymlink(src, dst);
await fs.ensureSymlink(src, dst, "dir");
await fs.ensureSymlink(src, dst, "file");
await fs.ensureSymlink(src, dst, "junction");
await fs.createSymlink(src, dst, "dir");
await fs.mkdirs(dir);
await fs.mkdirp(dir);
await fs.move(src, dst);
await fs.outputFile(path, "test");
await fs.outputFile(path, "test", writeOptions);
await fs.outputFile(path, new Buffer([1,2]));
await fs.outputFile(path, new Buffer([1,2]), writeOptions);
await fs.outputJson(path, data);
await fs.outputJson(path, data, writeJsonOptions);
await fs.outputJSON(path, data, writeJsonOptions);
let json = await fs.readJson(path);
json = await fs.readJson(path, readJsonOptions);
json = await fs.readJSON(path, readJsonOptions);
await fs.remove(path);
let dirs: string[] = await fs.walk(dir);
await fs.writeJson(path, data);
await fs.writeJson(path, data, writeJsonOptions);
await fs.writeJSON(path, data, writeJsonOptions);
return dirs;
}
示例2: async
const resetTestModule = async () => {
await fs.remove(testModulePath);
await fs.mkdirs(testModulePath);
await fs.writeFile(path.resolve(testModulePath, 'package.json'), await fs.readFile(path.resolve(__dirname, '../test/fixture/native-app1/package.json'), 'utf8'));
await spawnPromise('npm', ['install'], {
cwd: testModulePath,
stdio: 'inherit',
});
};
示例3: after
after(async () => {
await fs.remove(testModulePath);
});