本文整理汇总了TypeScript中q-io/fs.listTree函数的典型用法代码示例。如果您正苦于以下问题:TypeScript listTree函数的具体用法?TypeScript listTree怎么用?TypeScript listTree使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了listTree函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: listDefPaths
export function listDefPaths(dir:string):Q.Promise<string[]> {
var d:Q.Deferred<string[]> = Q.defer();
FS.listTree(dir, (full:string, stat:QioFS.Stats):boolean => {
return (stat.node.isFile() && /\.d\.ts$/.test(full));
}).then((paths:string[]) => {
d.resolve(paths.map((full:string) => {
return path.relative(dir, full).replace('\\', '/');
}).filter((short:string) => {
return tsd.Def.isDefPath(short);
}));
}).fail(d.reject);
return d.promise;
}
示例2:
anyQ = fs.read(path, options);
//strQ = fs.read(path, options);
//fs.read(path, options):Q.Promise<NodeBuffer>;
voidQ = fs.write(path, buffer, options);
voidQ = fs.write(path, str, options);
voidQ = fs.append(path, buffer, options);
voidQ = fs.append(path, str, options);
voidQ = fs.copy(source, target);
voidQ = fs.copyTree(source, target);
strArrQ = fs.list(path);
strArrQ = fs.listTree(path, (path, x) => {
return true;
});
strArrQ = fs.listDirectoryTree(path);
voidQ = fs.makeDirectory(path, str);
voidQ = fs.makeDirectory(path, num);
voidQ = fs.makeTree(path, str);
voidQ = fs.makeTree(path, num);
voidQ = fs.remove(path);
voidQ = fs.removeTree(path);
voidQ = fs.rename(source, target);
voidQ = fs.move(source, target);
voidQ = fs.link(source, target);