New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

drop-table

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drop-table

A small library for providing a random result from a list of pre-defined weighted options

latest
npmnpm
Version
1.0.14
Version published
Maintainers
1
Created
Source

DropTable

A small library for creating a loot table that can be use for receiving random loot in games.

It is simple to use, just create a new instance of DropTable.

let table = new DropTable();

And start adding items.

table.addItem({
    'name':'elixir',
    'data': {},
    'weight': 50
});

All weights are normalized so they don't need to be a percentage.

It also possible to initialize the DropTable with a list of items.

let table = new DropTable(items);

Remove items by name:

table.removeItem('elixir');

And of course get a random result

let result = table.drop();

Keywords

loot

FAQs

Package last updated on 08 Nov 2017

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