1.0.2 • Published 7 years ago

jammi v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

jammi

Standard - JavaScript Style Guide Dependency Status DevDependency Status NPM Downloads Travis Build Status

Simple solutions of lucky draw.

Install

$ npm install jammi

API

jammi.probability(prizes)

The most common method with setting probability.

  • prizes:
[
  {
    id: '61f55251-3b9c-498e-bbbe-c730de62a38d' // id of prize
    probability: 0.35 // probability of prize
  }

  ...
]

Return id or null.

jammi.pool(prizes)

Prize are threw into a imaginary pool. Every can get a prize when his / her hand reach the pool.

  • prizes:
[
  {
    id: '61f55251-3b9c-498e-bbbe-c730de62a38d' // id of prize
    balance: 124 // balance of prize
  }

  ...
]

Return id or null.

jammi.period (prizes, startTime, endTime)

Prizes are distributed on timeline between startTime to endTime. This method gains best effect of marketing.

  • prizes:
[
  {
    id: '61f55251-3b9c-498e-bbbe-c730de62a38d' // id of prize
    sum: 200 // sum of prize, including those which have been issued
    balance: 124 // balance of prize
  }
  ...
]
  • startTime: the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
  • endTime: the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

Return id or null.


1.0.2

7 years ago

1.0.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago