While I'm not aware of a pre-rolled function which will do the work for us, it's fairly trivial to grab all of the properties as you've indicated you'd like to.
Here's some code that will achieve it. First, we define a function that will give us forEach functionality on non-array objects. Next, we get the computedStyle of the target element before finally iterating through the collection of returned CSSStyleDeclaration objects, adding the property name and value to an object we later return.
"use strict";
// useful for NodeList & HtmlCollection types
function forEach(array, callback, scope){for (var i=0,n=array.length; i<n; i++)callback.call(scope, array[i], i, array);} // passes back stuff we need
window.addEventListener('load', onDocLoaded, false);
function onDocLoaded(evt)
{
var computedStyle = getTheStyle( document.getElementById('elem-container') );
alert("Element has a height of: " + computedStyle.height + "\n" + "And a position of: " + computedStyle.position);
}
function getTheStyle(tgtElement)
{
var result = {}, properties = window.getComputedStyle(tgtElement, null);
forEach(
properties,
function(prop)
{
result[prop] = properties.getPropertyValue(prop);
}
);
console.log(result);
return result;
}
#elem-container{
position: absolute;
left: 100px;
top: 200px;
height: 100px;
}
<div id="elem-container">dummy</div>
<div id="output"></div>