当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript fs.write函数代码示例

本文整理汇总了TypeScript中q-io/fs.write函数的典型用法代码示例。如果您正苦于以下问题:TypeScript write函数的具体用法?TypeScript write怎么用?TypeScript write使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了write函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: writeConfigFile

 writeConfigFile(config: any) {
   return fs.write(configFile, JSON.stringify(config, null , 2)).then(
     (data: any) => {return data; }, 
     (err: any) => {
       this.logger.log('Error on writing Config File!');
       this.logger.log(err);
     });
 }
开发者ID:DanielSchuech,项目名称:webend,代码行数:8,代码来源:configuration.ts

示例2: getLscAst

    return qFs.read(inputLambdaScriptFile).then(function(lambdaScriptCode: string) {
        const lscAst = getLscAst(lambdaScriptCode),
            jsAst = astToJsAst(lscAst);
        logger.debug({jsAst: jsAst}, 'Converted LambdaScript AST to JS AST');

        const js = escodegen.generate(jsAst);
        logger.debug({js: js}, 'Generated raw js');

        const jsWithPrelude = withPrelude(js);
        logger.debug({jsWithPrelude: jsWithPrelude}, 'Added prelude to raw js');

        return qFs.write(outputJsFile, jsWithPrelude);
    });
开发者ID:NickHeiner,项目名称:lambdascript,代码行数:13,代码来源:index.ts

示例3:

				}).then(() => {
					return FS.write(targetPath, file.blob.content);
				}).then(() => {
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:3,代码来源:Installer.ts

示例4:

var stream:Qio.Stream;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

fs.open(path, options).then((x) => {
});
//fs.open(path, options):Q.Promise<Qio.Reader>;
//fs.open(path, options):Q.Promise<Qio.Writer>;
//fs.open(path, options):Q.Promise<NodeBuffer>;

//TODO how to define the multiple return types? use any for now?
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);
开发者ID:3x14159265,项目名称:DefinitelyTyped,代码行数:31,代码来源:Q-io-tests.ts

示例5:

					return xm.file.mkdirCheckQ(gitTest.extraDir, true).then(() => {
						return FS.write(path.join(gitTest.extraDir, 'tmp_test.bin'), rawData, {flags:'wb'});
					}).then(() => {
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:3,代码来源:Github.ts


注:本文中的q-io/fs.write函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。