You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

html-element-size

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-element-size

Helper function to get size of unvisible HTML element or HTML element not attached to DOM

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

html-element-size

NPM Version Build Status Coverage Status

Helper function to get size of unvisible HTML element or HTML element not attached to DOM.

Installation

npm install html-element-size --save

Usage

  • require with Node.js:

    var htmlElementSize = require('html-element-size');
    
  • in browser include dist/html-element-size.js or dist/html-element-size.min.js script:

    var htmlElementSize = window.htmlElementSize;
    

and then

var size = htmlElementSize(document.querySelector('.my-element'), {
    removeClass: 'my-element-hidden',
    addClass: 'my-element-some-class'
});
console.log(size); // => { width: 200; height: 100 }

Building

In order to build library run:

npm run build

Testing

Run tests:

npm test

Run tests coverage:

npm run test:coverage

Contributing

Before making a pull request, please, be sure that your changes are rebased to develop branch.

License

MIT

Keywords

html

FAQs

Package last updated on 27 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts