0.0.12 • Published 8 years ago

mock-realtime v0.0.12

Weekly downloads
3
License
MIT
Repository
github
Last release
8 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

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago