Have ideas to improve npm?Join in the discussion! »

    probster

    1.0.6 • Public • Published

    Probster🦞

    Get Random Value with Probability settings

    Usage

    1. Install npm package
    npm install probster
    
    1. require from javascript source file
    const Probster = require('probster');
    
    1. Custom Probability?
    const probs = [
        Probster.Probability(10, 'Ten percent probability'),
        Probster.Probability(20, 'Twenty percent probability'),
        Probster.Probability(30, 'Thirty percent probability'),
        Probster.Probability(40, 'Fourty percent probability'),
    ];
    console.log(Probster.get_custom_probability_result(probs));
    
    1. Equal Probability?
    const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    console.log(Probster.get_equal_probability_result(arr));
    

    Keywords

    Install

    npm i probster

    DownloadsWeekly Downloads

    1

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    2.8 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar