Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

asteroids-bag

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asteroids-bag

An implementation of a bag tailored to Asteroids

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

asteroids-bag

An implementation of a bag tailored to Asteroids

Examples

var Bag = require('asteroids-bag');

var bag = new Bag();
var identifier = bag.add({ 'an': 'object' });

bag.forEach(function(element, id){
    console.log('we found an element with id: %s', id);
    console.log(element);
})

bag.remove(identifier);
bag.forEach(function(){
    console.log('this will not show because bag is empty');
});

Output:

we found an element with id: f624a2c94c204058b9689687d1868a22
{ an: 'object' }

Keywords

asteroids

FAQs

Package last updated on 21 Nov 2013

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