How to use properties - 10 common examples

To help you get started, we’ve selected a few properties examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Corey600 / node-disconf-client / index.js View on Github external
fs.readFile(_path, function (err, data) {
                if (err) return callback(err);
                try {
                    data = properties.parse(data.toString(), {namespaces: true, variables: true, sections: true});
                } catch (e) {
                    return callback(e);
                }
                // file has the highest priority
                self._option = _.defaults(data, option, self._option);
                log.info('the DisconfClient\'s option content: ' + JSON.stringify(self._option));
                self._getZkInfo(callback);
            });
        } else {
github logdna / logdna-agent / test / lib / file-utilities.js View on Github external
return async.waterfall([(cb) => {
                return properties.parse(configPath, {
                    path: true
                }, cb);
            }, (config, cb) => {
                return utils.saveConfig(config, path.join(tempDir, 'test.config'), cb);
github gagle / node-seraphim / test / index.js View on Github external
vault.extension (".properties", function (p, cb){
      properties.parse (p, propertiesOptions, cb);
    });
github BorderTech / wcomponents / wcomponents-theme / propertiesToJson.js View on Github external
function readPropertiesFile(propertiesFile, jsonFile) {
	properties.parse(propertiesFile, { path: true }, function (error, obj) {
		var jsonString;
		if (error) return console.error (error);
		jsonString = JSON.stringify(obj, null, 1);
		fs.writeFile(jsonFile, jsonString, function(err) {
			if (err) {
				return console.log(err);
			}
			console.log("Wrote file ", jsonFile);
		});
	});
}
github BorderTech / wcomponents / wcomponents-theme / build-resource.js View on Github external
function readPropertiesFile(propertiesFile, jsonFile) {
	properties.parse(propertiesFile, { path: true }, function (error, obj) {
		var jsonString;
		if (error) return console.error (error);
		jsonString = JSON.stringify(obj, null, 1);
		fs.writeFileSync(jsonFile, jsonString);
	});
}
github Corey600 / node-disconf-client / lib / DisconfClient.js View on Github external
fs.readFile(_path, function (err, data) {
                if(err) return cb(err);
                data = properties.parse(data.toString(), {namespaces: true, variables: true, sections: true});
                option = option || {};
                self._option = _.defaults(option, data, self._option);
                info('The DisconfClient\'s option content: ' + JSON.stringify(option));
                self.getZkInfo(cb);
            });
        }else{
github phac-nml / irida / src / main / webapp / webpack / i18nPropertiesPlugin.js View on Github external
const parse_messages = source => {
  const messages_source = fs.readFileSync(source, { encoding: "utf-8" });
  return properties.parse(messages_source, { namespaces: false });
};
github vlocityinc / vlocity_build / grunt / loadProperties.js View on Github external
function loadProperties(file, returnNullOnFail) {
    try {
      if (fs.statSync(file)) {
        return properties.parse(grunt.file.read(file));
      }
    } catch (e) {
      grunt.log.errorlns('Could not load properties file from ' + file);
      grunt.verbose.errorlns(e);
      if (returnNullOnFail) {
        return null;
      }
    }
    return {};
  }
github gagle / node-seraphim / t.js View on Github external
vault.extension (".properties", function (p, cb){
	properties.parse (p, optionsProperties, cb)
});
github gagle / node-seraphim / examples / readdir / index.js View on Github external
.extension (".ini", function (file, cb){
          properties.parse (file, {
            path: true,
            sections: true,
            comments: ";",
            separators: "=",
            strict: true
          }, cb);
        })
        .extension ([".yaml", ".yml"], function (file, cb){

properties

.properties parser/stringifier

MIT
Latest version published 11 years ago

Package Health Score

65 / 100
Full package analysis

Popular properties functions