dist/ini.js
function stringifySync(obj) {
	var output = "";
	var firstOccur = true;

	Object.keys(obj).forEach(function (key) {
		if (typeof obj[key] === "string") {
			output += key + "=" + obj[key];
			output += os.EOL;
		} else {
			if (firstOccur) {
				firstOccur = false;
			} else {
				output += os.EOL;
			}

			output += "[" + key + "]";
			output += os.EOL;
			Object.keys(obj[key]).forEach(function (innerKey) {
				var value = obj[key][innerKey];
				if (typeof value === "string") {
					// if value can ber converted to number or boolean,
					// but it should be a string,
					// so keep the quotes to indicate its type
					if (!isNaN(value) || value.toLowerCase() === "true" || value.toLowerCase() === "false") {
						value = "\"" + value + "\"";
					}
				}

				output += innerKey + "=" + value;
				output += os.EOL;
			});
		}
	});

	return output;
}
function stringifySync(obj) {
	var output = "";
	var firstOccur = true;

	Object.keys(obj).forEach(function (key) {
		if (typeof obj[key] === "string") {
			output += key + "=" + obj[key];
			output += os.EOL;
		} else {
			if (firstOccur) {
				firstOccur = false;
			} else {
				output += os.EOL;
			}

			output += "[" + key + "]";
			output += os.EOL;
			Object.keys(obj[key]).forEach(function (innerKey) {
				var value = obj[key][innerKey];
				if (typeof value === "string") {
					// if value can ber converted to number or boolean,
					// but it should be a string,
					// so keep the quotes to indicate its type
					if (!isNaN(value) || value.toLowerCase() === "true" || value.toLowerCase() === "false") {
						value = "\"" + value + "\"";
					}
				}

				output += innerKey + "=" + value;
				output += os.EOL;
			});
		}
	});

	return output;
}
function stringifySync ( obj ) { var output = "" ; var firstOccur = true ; Object . keys ( obj ) . forEach ( function ( key ) { if ( typeof obj [ key ] === "string" ) { output += key + "=" + obj [ key ] ; output += os . EOL ; } else { if ( firstOccur ) { firstOccur = false ; } else { output += os . EOL ; } output += "[" + key + "]" ; output += os . EOL ; Object . keys ( obj [ key ] ) . forEach ( function ( innerKey ) { var value = obj [ key ] [ innerKey ] ; if ( typeof value === "string" ) { // if value can ber converted to number or boolean, // but it should be a string, // so keep the quotes to indicate its type if ( ! isNaN ( value ) || value . toLowerCase ( ) === "true" || value . toLowerCase ( ) === "false" ) { value = "\"" + value + "\"" ; } } output += innerKey + "=" + value ; output += os . EOL ; } ) ; } } ) ; return output ; }
Stringify an object to an ini-format string
@param {Object} obj Object to be stringify
@returns {string} INI-format string which is stringified from given object
Stringify an object to an ini - format string