Have ideas to improve npm?Join in the discussion! »

    page-ruler

    1.0.0 • Public • Published

    Page Ruler

    Measure document, viewport and offset without jQuery.

    Install

    First install Page Ruler in your project root.

    $ npm install --save page-ruler
    

    Then include in your module using require().

    var ruler = require('page-ruler');

    Use

    The following methods are available:

    ruler.document(); // Returns { width, height } object
    ruler.documentWidth();
    ruler.documentHeight();
     
    ruler.viewport(); // Returns { width, height } object
    ruler.viewportWidth();
    ruler.viewportHeight();
     
    ruler.offset(); // Returns { top, left } object
    ruler.offsetTop();
    ruler.offsetLeft();

    Install

    npm i page-ruler

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar