本文整理匯總了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);