Skip to main content

Ready to Use Constants

Along with utilities, classes and types, nhb-toolbox exports a collection of ready-to-use constants for common development needs.

📦 Import

All (25+) constants can be imported using this pattern:

import { CONSTANT_NAME } from 'nhb-toolbox/constants';

Available Constants

ConstantDescription
WEEK_DAYSArray of weekday names (Sunday-Saturday)
MONTHSArray of month names (January-December)
TIME_ZONESRecord of 212 time-zones (abbreviation of timezone names from time zone abbreviations on Wikipedia) with respective time-zone offsets and full timezone names.
TZ_ABBREVIATIONSAlias for TIME_ZONES
TIME_ZONES_NATIVERecord of 418 timezone identifiers (from Intl.supportedValuesOf('timeZone')) against their corresponding UTC offsets and full timezone names.
TIME_ZONE_IDSRecord 597 of timezone identifiers (from IANA TZ Database on Wikipedia) against their corresponding UTC offsets and full timezone names.
IANA_TZ_IDSArray of 597 timezone identifiers (from IANA TZ Database on Wikipedia).
TIME_ZONE_LABELSRecord of unique standard time-zone labels/names for their corresponding UTC offsets as ({ UTCOffset: timeZoneName }).
VEDIC_ZODIAC_SIGNSTraditional Indian/Vedic zodiac signs
WESTERN_ZODIAC_SIGNSWestern astrology zodiac signs
AUSTRALIA_SEASONSSeasonal definitions for Australia
BANGLADESH_SEASONSSeasonal definitions for Bangladesh
ETHIOPIA_SEASONSSeasonal definitions for Ethiopia
INDIA_IMD_SEASONSIndian Meteorological Department seasons
INDIA_TAMIL_SEASONSTraditional Tamil seasonal calendar
INDIA_VEDIC_SEASONSAncient Vedic seasonal divisions
JAPAN_SEASONSTraditional Japanese seasons
PHILIPPINES_SEASONSSeasonal patterns for the Philippines
SEASON_PRESETSCollection of all seasonal definitions
US_ACADEMIC_SEASONSU.S. academic season names
WESTERN_SEASONSStandard four-season model (Spring, Summer, Fall, Winter)
ALPHABET_COLOR_PALETTEColor palette mapped to letters A-Z
NUMBER_COLOR_PALETTEColor palette mapped to numbers 0-9
CSS_COLORSStandard CSS color names and hex values
COUNTRIESList of countries with full-name, country code and ISO country code (both 2 & 3 character)
CURRENCY_CODESISO 4217 currency codes (e.g., USD, EUR)
CURRENCY_LOCALESDefault locales for currency formatting
FRANKFURTER_CURRENCIESCurrencies supported by Frankfurter API
LOCALE_CODESStandard locale identifiers (e.g., en-US, fr-FR)
LOWERCASED_WORDSCommon lowercase words (articles, prepositions etc.) for text processing
HTTP_STATUS_CODESComplete set of HTTP status codes with with js/tsdoc
HTTP_STATUSAlias for HTTP_STATUS_CODES
HTTP_CODESAlias for HTTP_STATUS_CODES
STATUS_CODESAlias for HTTP_STATUS_CODES
GENERAL_UNITSUnits used in Unit class
CATEGORIZED_UNITSUnits used in Converter classes

Usage Examples

import { MONTHS, CSS_COLORS, HTTP_STATUS_CODES } from 'nhb-toolbox/constants';

console.log(MONTHS[0]); // "January"
console.log(CSS_COLORS.white); // "#FFFFFF"
console.log(HTTP_STATUS_CODES.NOT_FOUND); // 404
tip

All constants are fully typed and include IntelliSense support in TypeScript-enabled editors.