當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。