New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

wetbox

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wetbox

A collection of prototype tools

Source
npmnpm
Version
0.2.25
Version published
Weekly downloads
18
350%
Maintainers
1
Weekly downloads
 
Created
Source

alt text

Functions

getVersion()
Returns the current in-use version of the library

getUrl( url, callback )
Fetches an external API url (typically json) and performs callback( status, response ) when loaded.
Status being a nubmer (ie 400), and response being the data.

keyListen( isEnable, up, down, left, right, space, ctrl)
Adds some keyboard listeners to the page for typical game commands. All input parameters are callback functions.

wet = require( wetbox );
wet.keyListen( 
  () => { return true },
  () => { console.log( 'up' ) }, 
  () => { console.log( 'down' ) }, 
  () => { console.log( 'left' ) }, 
  () => { console.log( 'right' ) }, 
  () => { console.log( 'space' ) }, 
  () => { console.log( 'ctrl' ) } 
);

randomizeArray( array )
Returns array with random-ordered elements using the Fisher-Yates-Knuth shuffle.

leftPad( str, len, fillerChar )
Pads a string up to length len, with single-char: fillerChar

Keywords

prototype

FAQs

Package last updated on 06 Aug 2018

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