Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
wetbox
Advanced tools
Readme
npm install wetbox
let WET = require( 'wetbox' )
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.
zeros( n )
Returns an array of zeros of lenth n
sequence( n )
Returns an array of numbers from 0 .. n-1
randInt( n )
Returns a random int from 0 .. n-1
clearEmptyElements( array )
Remove all zero and falsy values from an array
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 (defaults to space character)
toRadians( x )
Convert x degrees to radians
toDegrees( x )
Convert x radians to degrees
hasDuplicates( n )
Returns true if array contains duplicates
choose( n, k )
The mathematical choose function. One-indexed
ithIteration( n, k, i )
Alias for ithCombination( n, k, i )
inverseIthIteration( n, combinationArray )
Alias for inverseIthCombination( n, combinationArray )
ithCombination( n, k, i )
Given a set of n
items, k
choices, and an index i
, give me a k-sized array of the ith combination. 0 <= i < n.
inverseIthCombination( n, combinationArray )
Given a number n
and combinationArray, convert the array into an ith ordering. k is infered from combinationArray
s length.
new WET.game( THREE, gameTitle )
Given a three.js library let THREE = require( 'three' )
, initialize a basic game environment using threejs. ie in index.js
WET = require( 'wetbox' )
THREE = require( 'three' )
game = new WET.Game( THREE, 'Wizzy boi' )
keyListen( isEnable, up, left, down, right, crouch, space, esc, tab, enter )
Adds some keyboard listeners to the page for typical game commands. All input params are callback functions, first 5 are mandatory.
WET.keyListen(
enabled => { return true },
up => { console.log( 'up' ) },
left => { console.log( 'left' ) },
down => { console.log( 'down' ) },
right => { console.log( 'right' ) },
crouch => { console.log( 'crouch' ) },
space => { console.log( 'space' ) },
esc => { console.log( 'esc' ) },
tab => { console.log( 'tab' ) },
enter => { console.log( 'enter' ) },
)
keyUpListen( up, left, down, right, crouch )
Adds key-release listeners for switch-keys, all args are callbacks and always enabled.
WET.keyUpListen(
releaseUp => { console.log( 'release up' ) },
releaseLeft => { console.log( 'release left' ) },
releaseDown => { console.log( 'release down' ) },
releaseRight => { console.log( 'release right' ) },
releaseCrouch => { console.log( 'release crouch' ) },
)
Updating
npm publish --dry-run
npm publish
FAQs
A collection of prototype tools
The npm package wetbox receives a total of 2 weekly downloads. As such, wetbox popularity was classified as not popular.
We found that wetbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.