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