You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

random-day

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-day

Generate a random day.

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

random-day

Generate a random day.

MIT License

build:? coverage:?

Install

$ npm install --save random-day 

Usage

var randomDay = require('random-day');
  
// API
// - randomDay([options]);
  
// options
// - year
// - month
// - min
// - max

By default, returns a day in a random month, from 1 to 31.

randomDay();
// => 23

Optionally specify month:

randomDay({ month: 1 }); // 1~31
// => 12

Optionally specify year when month is 2 to figure out leap years:

randomDay({ year: 2016 month: 2 }); // 1~29
// => 18

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

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

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

randomDay({ min: 3, max: 9 });
// => 6

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Keywords

day

FAQs

Package last updated on 25 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts