![ISC License](https://camo.githubusercontent.com/adcba98c8fa86875e044d6b3c2beefc2802cf9417134f0bcf1e64ce8f149ae42/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4953432d677265656e2e7376673f7374796c653d666c6174)
$ npm install --save get-outer-size
import getOuterSize from 'get-outer-size';
const element = document.getElementById('my-element');
const {width, height} = getOuterSize(element);
// width = element width + border width + margin-right + margin-left
// height = element width + border width + margin-top + margin-bottom
.div {
margin: 10px 20px 15px;
width: 100px;
height: 100px;
}
const element = document.getElementById('my-element');
const {width, height} = getOuterSize(element);
width; // => 140 (100px + 20px + 20px)
height; // => 125 (100px + 10px + 15px)