/is-night-mode

🌓 Check if is night mode based on current time or localStorage item or OS theme

Primary LanguageJavaScriptMIT LicenseMIT

is-night-mode Build Status

Check if is night mode

Install

$ npm install is-night-mode
# or
$ yarn add is-night-mode

Usage

const isNightMode = require("is-night-mode");
// default options
const options = {
  day: 6,
  night: 20,
  checkLocalStorage: false,
  itemName: "night-mode",
  checkOSTheme: false
};

isNightMode(); // without passing options default options are defined
//=> true || false
isNightMode(options); // with passing custom options
//=> true || false

License

MIT © Abdessalam BENHARIRA