New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

squaresplit

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

squaresplit

A tiny library for spitting a square into smaller squares

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

squaresplit

A tiny JavaScript library for splitting a single square container into multiple squares. which is useful for generating CSS sprites and WebGL textures. This library was inspired by mapbox/potpack

Demo

Example usage

import squaresplit from 'squaresplit';

const numberOfSquares = 50
const size = 1024 // optional

const {squares fill} = potpack(numberOfSquares,size);
// squares is resulting squares with format {w: number, h: number,  x: number, y: number}
// fill is the space utilization value (0 to 1), higher is better

//squares are ordered from biggest width to least
squares[0]; // {w: 300, h: 300,  x: 0, y: 0}
squares[1]; // {w: 100, h: 100, x: 100,   y: 0}

Install

Install with NPM: npm install squaresplit.

In Node, you can't use require — only import in ESM-capable versions (v12.15+):

import squaresplit from 'squaresplit';

Keywords

FAQs

Package last updated on 23 Oct 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc