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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sandpit

v0.1.15

Published

A playground for creative coding using JavaScript and the canvas element

Downloads

78

Readme

⛱ Sandpit

A playground for creative coding using JavaScript and the canvas element.

npm install sandpit --save

npm Build Status

NOTE: Sandpit is pretty new, so the API is likely to change between now and 1.0. Help shape its ongoing development by reporting issues and making suggestions. 💖

An example animation of Sandpit

Built in ES6, Sandpit uses dat.GUI to manage settings and encourages copy and paste sharing of ideas. It features a bunch of helpers so you can get straight down to coding.


Getting Started

Add Sandpit to your project:

npm install sandpit --save

Or if you're into Yarn, that works too:

yarn add sandpit

In your app, add:

import Sandpit from 'sandpit' // for es6
var Sandpit = require('sandpit').default // for es5

Celebrate. You are a success.

Setting up a new project

If you're looking for a quick way to set up a sandpit with an ES6 friendly environment, you can use create-react-app:

npm install create-react-app -g
create-react-app party
cd party
npm install sandpit --save
npm start

Then replace src/index.js with:

import Sandpit from 'sandpit'

var sandpit = new Sandpit('body', Sandpit.CANVAS)
sandpit.settings = {youAreGreat: {value: true}}
sandpit.loop = () => { console.log(sandpit.time) }
sandpit.start()

You can grab an example from https://github.com/sandpit/sandpit-create-react-app-demo, too.

Sticking with the script tag

Alternatively, you can use the latest Sandpit version in the browser, which is useful for Codepen and the like.

<script src="https://sandpitjs.com/dist/sandpit.min.js"></script>
<script>var sandpit = new Sandpit('body', Sandpit.CANVAS)</script>

You can see it in action using ES6, and ES5.

Browser support

Currently Sandpit targets modern browsers, including IE11 and Edge, and uses babel-polyfill when compiled for ES5.

Why use Sandpit?

The goal of Sandpit is to normalise and simplify the process of creative coding—using code to make pretty things. This usually takes the form of drawing onto the Canvas element, in either a 2d or 3d context. It has resulted in a ton of tools, from Processing.js to Three.js, and an incredible community of people who have pushed the bar of what can be done on the web.

Sandpit supports a bunch of key features that aim to simplify creative coding. Specifically, helps with the following:

  • Manages inputs, like touches, taps, clicks, force and the accelerometer, and takes care of touch event handling for multitouch on mobile so you don't have to worry about pinch to zoom
  • Makes it easy to drop in settings, with a simple API for specifying ranges, types and defaults (with dat.GUI behind the scenes)
  • Stores settings in the query string, so you can copy and paste them without needing to touch a line of code
  • Offers a bunch of helpers, covering maths, color and vector manipulation (kudos to color and Victor)
  • Supports bringing your own canvas—for example, to simplify using Three

Demos and examples

Some examples of Sandpit in action

There are a bunch of examples at https://sandpitjs.com, the source for which can be found at https://github.com/sandpit/sandpit-site/.

Documentation

Look no further—here's documentation of the full API.

Want to contribute?

You 100% should. You can find out more about contributing here, and we more than appreciate pull requests, issues, and seeing the rad stuff you've made.

Who's behind it?