當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript properties-reader.default函數代碼示例

本文整理匯總了TypeScript中properties-reader.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getProperty

 private static getProperty(key: string, defaultValue: string): string {
     let PropertiesReader = require('properties-reader');
     let properties = PropertiesReader(__dirname + '/../../../../test/integration/data/integrationtest.properties');
     let value = properties.get(key);
     if (value) {
         return value;
     } else {
         return defaultValue;
     }
 }
開發者ID:andi-git,項目名稱:nodejs-test,代碼行數:10,代碼來源:integrationtest.config.ts

示例2: initialize

    public initialize(): void {
        let awsConfig: any = null;

        // If bst lambdaDeploy is missing we need to upgrade

        if (!Global.config().configuration.lambdaDeploy) {
            Global.config().configuration.lambdaDeploy = LambdaConfig.defaultConfig().lambdaDeploy;
            Global.config().save();
        }

        let bstConfig: any = Global.config().configuration.lambdaDeploy;

        // Get AWS credentials and region first

        try {
            let home: string = process.env[(process.platform === "win32") ? "USERPROFILE" : "HOME"];

            awsConfig = PropertiesReader(home + "/.aws/config").append(home + "/.aws/credentials");
        } catch (err) {
            if (err.code === "ENOENT") {
                console.log("Warning! AWS configuration files (in ~/.aws) are missing!");
            } else {
                throw err;
            }
        }

        // Process anv variables take precedence

        if (awsConfig) {
            this.AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID || awsConfig.get("default.aws_access_key_id");
            this.AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY || awsConfig.get("default.aws_secret_access_key");
            this.AWS_REGION = process.env.AWS_REGION || awsConfig.get("default.region") || "us-east-1";
        } else {
            this.AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID;
            this.AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY;
            this.AWS_REGION = process.env.AWS_REGION || "us-east-1";
        }

        this.AWS_FUNCTION_NAME = bstConfig.functionName || "";
        this.AWS_RUNTIME = bstConfig.runtime || "nodejs4.3";
        this.AWS_ROLE = bstConfig.role;
        this.AWS_HANDLER = bstConfig.hander || "index.handler";
        this.AWS_DESCRIPTION = bstConfig.description || "My BST lambda skill";

        this.AWS_TIMEOUT = bstConfig.timeout || 5;
        this.AWS_MEMORY_SIZE = bstConfig.memorySize || 128;

        this.AWS_PUBLISH = true;

        this.AWS_VPC_SUBNETS = bstConfig.vpcSubnets || "";
        this.AWS_VPC_SECURITY_GROUPS = bstConfig.vpcSecurityGroups || "";

        this.EXCLUDE_GLOBS = bstConfig.excludeGlobs || "";

    }
開發者ID:bespoken,項目名稱:bst,代碼行數:55,代碼來源:lambda-config.ts

示例3: init

 init() : void{
     this.tasteeCodes = [];
     this.properties = propertiesReader();
 }
開發者ID:tastee,項目名稱:tastee-core,代碼行數:4,代碼來源:tastee-analyser.ts

示例4: constructor

 constructor(public pathSettings:string){
      let properties = PropertiesReader(pathSettings);
      this.serverPort = properties.get('mongo.port');
      this.serverName = properties.get('mongo.server');         
      console.log("Mongo Connection: "+this.serverPort+":"+this.serverName);         
 }    
開發者ID:deivit78,項目名稱:ratteator,代碼行數:6,代碼來源:settings.ts


注:本文中的properties-reader.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。