npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xslet/datatype

v0.2.2

Published

Defines data types used in xslet packages.

Readme

@xslet/datatype Github.io NPM version MIT License Coverage Status

Defines data types and utilities used in xslet packages.

Install

Install from npm

Executes following command to install this package from npm.

$ npm install --save @xslet/datatype

Load this package in a browser

<script src="xslet.datatype.min.js"></script>

Usage

Rect

var Rect = xslet.datatype.Rect;

Rect rect = Rect({ left: 10, top: 20, width: 100, height: 50 })

console.log(rect)
// => { left: 10, top: 20, right: 90, bottom: 30, width: 100, height: 50 }

console.log(rect.right)
// => 110

rect.top = 30
rect.bottom = 200

console.log(rect)
// => { left: 10, top: 30, right: 90, bottom: 200, width: 100, height: 170 }

APIs

Rect

Represents a rectangle.

Each of .right and .width properties are calculated automatically with another properties and .left. As well as each of .bottom and .height properties are calculated automatically with another properties and .top.

When .left and .top properties are changed, the rectangle is moved and .width and .height are not changed.

The unit of this value is not specified. In xslet package, it would be determined by xslet.window.unitOfSize.

Properties:

  • .top {number} - The top position of this rectangle.
  • .left {number} - The left position of this rectangle.
  • .right {number} - The right position of this rectangle.
  • .bottom {number} - The bottom position of this rectangle.
  • .width {number} - The width position of this rectangle.
  • .height {number} - The height position of this rectangle.

Constructor:

  • Rect()

    Creates a Rect object of which all properties is zero.

  • Rect(obj)

    Creates a Rect object of which properties are corner positions or size of a rectangle.

    Parameters:

    • obj {object}

      An object which supposed to have either or all following properties: .left, .top, .right, .bottom, .width and .height. If all .left, .right and .width properties are specified but .width is different from .right - .left, .right is changed to .left + .width. It is also same about .top, .bottom and .height.

Behavior checks on browsers

Show this page: https://xslet.github.io/datatype/test.html.

License

Copyright (C) 2016-2019 Takayuki Sato

This program is free software under MIT License. See the file LICENSE in this distribution for more details.