JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 223
  • Score
    100M100P100Q107849F
  • License MIT

Generate a random hour.

Package Exports

  • random-hour

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (random-hour) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

random-hour

Generate a random hour.

MIT License

build:? coverage:?

Install

$ npm install --save random-hour 

Usage

var randomHour = require('random-hour');

// API
// - randomHour([options]);

// options
// - twentyFour
// - min
// - max

By default, returns an hour from 1 to 12 for a standard 12-hour clock:

randomHour();
// => 9

Can optionally specify a full twenty-four:

randomHour({ twentyFour: true });
// => 14

Optionally specify min, max, or both to limit the range.

randomHour({ min: 10 });
// => 11

randomHour({ max: 10 });
// => 7

randomHour({ min: 5, max: 10 });
// => 8

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.