Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

premium-friday

0.0.1 • Public • Published

premium-friday

npm version install size Build Status

This is JavaScript Library for Premium Friday. Helps to find Premium Friday.

Install

# npm 
$ npm install premium-friday
 
# or yarn 
$ yarn add premium-friday

Use

const pFriday = require('premium-friday');
 
// Sat Nov 10 2018 09:00:00 GMT+0900 (日本標準時)
 
const premium = pFriday.get(); // new Date('2018-11-30')
const isPremium = pFriday.isPremium(); // false
 
//----------------------------------------------------
 
// Fri Nov 30 2018 09:00:00 GMT+0900 (日本標準時)
 
const premium = pFriday.get(); // new Date('2018-11-30')
const idPremium = pFriday.isPremium(); // true
 

Documents

.get()

// Sat Dec 01 2018 00:00:00 GMT+0900 (日本標準時)
 
const premium = pFriday.get();
console.log(premium); // Fri Dec 28 2018 09:00:00 GMT+0900 (日本標準時)

Returns Date which is next Premium Friday.

If now is November 5, 2018, get() return new Date('2018-11-30') because last friday in November is 30th.

.isPremium([date, [month, day]])

// Fri Nov 30 2018 09:00:00 GMT+0900 (日本標準時)
 
const isPremium = pFriday.isPremium(); // true
const isPremium = pFriday.isPremium('2018-11-30'); // true
const isPremium = pFriday.isPremium(2018, 11, 30); // true
const isPremium = pFriday.isPremium(new Date(2018, 10, 30)); // true
 
//--------------------------------------------------
 
// Sat Dec 01 2018 00:00:00 GMT+0900 (日本標準時)
 
const isPremium = pFriday.isPremium(); // false
const isPremium = pFriday.isPremium('2018-11-30'); // true
const isPremium = pFriday.isPremium(2018, 11, 30); // true
const isPremium = pFriday.isPremium(new Date(2018, 10, 30)); // true

Returns boolean. If .isPremium() args is Premium Friday, return true.

Install

npm i premium-friday

DownloadsWeekly Downloads

5

Version

0.0.1

License

MIT

Unpacked Size

5.8 kB

Total Files

6

Last publish

Collaborators

  • avatar