0.0.12 • Published 9 years ago

mock-realtime v0.0.12

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

mock-realtime

mock real time data as JSON

preview

'use strict';
const realtime = require('mock-realtime');
const Day = realtime.Day;

let now = Day({
  hours: { min: 10, max: 13},
  minutes: { min: 0, max: 59},
  seconds: { min: 0, max: 59},
  milliseconds: { min: 0, max: 999}
}, Date.now());

console.log(now.get().toString());
console.log(now.next().toString());
console.log(now.next().toString());

range integer biased by weekday

let biasedIntegerGenerator = realtime.rangeIntegerBiasedByWeekdays(0, 20, {
  0: { min: 0, max: 0 }, //sunday
  6: { min: 0, max: 0 }  //saturday
});

for(var i=0; i<7; i+=1){
  let current = now.next();
  console.log(current.get().toString(), biasedIntegerGenerator(current.get()));
}

License

MIT © Andre Stehle

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago