{"id":15011269,"url":"https://github.com/jalal246/aleppo","last_synced_at":"2025-10-03T20:31:59.749Z","repository":{"id":57175567,"uuid":"90606904","full_name":"jalal246/aleppo","owner":"jalal246","description":"A JavaScript Functions For Date, Time, Delay, Validation And Function-Execution.","archived":true,"fork":false,"pushed_at":"2017-07-02T19:08:11.000Z","size":238,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-14T04:57:20.288Z","etag":null,"topics":["date","day-count","delay","isnull","isvalid","iterator","javascript","javascript-tools","leap","milliseconds","node","node-js","node-modules","nodejs","nodejs-modules","time","timestamp","validation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jalal246.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-08T08:55:00.000Z","updated_at":"2024-08-10T10:08:51.000Z","dependencies_parsed_at":"2022-09-03T23:31:18.414Z","dependency_job_id":null,"html_url":"https://github.com/jalal246/aleppo","commit_stats":null,"previous_names":["jimmy02020/aleppo"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Faleppo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Faleppo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Faleppo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalal246%2Faleppo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalal246","download_url":"https://codeload.github.com/jalal246/aleppo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235184526,"owners_count":18949258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","day-count","delay","isnull","isvalid","iterator","javascript","javascript-tools","leap","milliseconds","node","node-js","node-modules","nodejs","nodejs-modules","time","timestamp","validation"],"created_at":"2024-09-24T19:40:04.862Z","updated_at":"2025-10-03T20:31:54.425Z","avatar_url":"https://github.com/jalal246.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aleppo\n\n[![NPM](https://nodei.co/npm/aleppo.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/aleppo/)\n\n[![Travis](https://img.shields.io/travis/rust-lang/rust.svg)](https://travis-ci.org/Jimmy02020/aleppo)\n[![Codecov](https://img.shields.io/codecov/c/github/codecov/example-python.svg)](https://codecov.io/gh/Jimmy02020/aleppo)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/Jimmy02020/aleppo/blob/master/LICENSE)\n\nOverview\n--------\nAleppo is utility functions written in [JavaScript](http://en.wikipedia.org/wiki/JavaScript).\n\nUsage\n-------------\n\n### Validation - IS\n* [npm package](#npm_is)\n* [isUn](#isUn)\n* [isNull](#isNull)\n* [isValid](#isValid)\n* [isObj](#isObj)\n* [isBool](#isBool)\n* [isNum](#isNum)\n* [isStr](#isStr)\n* [isFn](#isFn)\n* [isArr](#isArr)\n* [isZeroLength](#isZeroLength)\n* [isStrEmpty](#isStrEmpty)\n* [isArrEmpty](#isArrEmpty)\n\n\n### Function execution - DOO\n* [npm package](#npm_doo)\n* [iterator](#doo_iterator)\n* [array](#doo_array)\n* [object](#doo_object)\n\n### Time and date\n* [delay](#delay)\n  * [npm package](#npm_delay)\n  * [options allowed](#delay_options)\n* [date](#date)\n  * [npm package](#npm_date)\n  * [now](#date_now)\n  * [later](#date_later)\n  * [ago](#date_ago)\n  * [readTs](#date_readTs)\n  * [isLeap](#date_isLeap)\n  * [isCommon](#date_isCommon)\n  * [yearType](#date_yearType)\n  * [daysCountInMonth](#date_dayCountInMonth)\n  * [countBtw](#date_countBtw)\n  * [options allowed](#date_options)\n  * [separators allowed](#date_separators)\n\n### Other\n\n* [Tests](#Tests)\n* [License](#License)\n\n\n\nGetting Started\n---------------\n\nclone the repo:\n```sh\ngit clone git@github.com:jimmy02020/aleppo.git\ncd aleppo\n```\n\nUsing npm:\n```sh\n$ npm install aleppo\n```\n\nValidation - IS\n--------------\n\nBoolean validation functions. IS-functions can deal with one argument or multiple arguments as it accepts the [spread syntax](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Spread_operator).\n\n\u003ca name=\"npm_is\" /\u003e\n\n```bash\n$ npm i aleppo.is\n```\n\n\u003ca name=\"isUn\" /\u003e\n\n### isUn (...inputs)\n\nChecks if undefined returns true, otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isUn } = require('aleppo')\nisUn(undefined, a, b, c, d, e) // true\nisUn('hi', 'there', 'I am defined') // false\nisUn('defined', y, undefined) // false. one of parameters failed to pass.\n```\n\u003ca name=\"isNull\" /\u003e\n\n### isNull(...inputs)\n\nChecks if null returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isNull } = require('aleppo')\nisNull(null, null) // true\nisNull(null, \"hi\") // false, one of the parameters failed.\nisNull(undefined, null, 'still', 'false', 'because', 'of undefined and null') // false\n```\n\n\u003ca name=\"isValid\" /\u003e\n\n### isValid(...inputs)\n\nChecks if not being undefined or null returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isValid } = require('aleppo')\nisValid(\"welcome\", \"to\", \"the\", \"club\") // true\nisValid(null, \"hi\") // false, one of the parameters failed.\nisValid(undefined, null, 'still', 'false', 'because', 'of undefined and null') // false\n```\n\u003ca name=\"isObj\" /\u003e\n\n### isObj(...inputs)\n\nChecks if object returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isObj } = require('aleppo')\nisObj({ boo: 'foo' }, { baz: 'doo' }) // true\nisObj(null, { boo: 'foo' }, { baz: 'doo' }) // false\n```\n\u003ca name=\"isBool\" /\u003e\n\n### isBool(...inputs)\n\nChecks if Boolean returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isBool } = require('aleppo')\nisBool(true, false) // true\nisBool(1,2,3,4,5,6,7,100) // false\n```\n\u003ca name=\"isNum\" /\u003e\n\n### isNum(...inputs)\n\nChecks if numbers returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isNum } = require('aleppo')\nisNum('hello') // false\nisNum(1,2,3,4,5,6,7,100) // true\n```\n\n\u003ca name=\"isStr\" /\u003e\n\n### isStr(...inputs)\n\nChecks if string returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isStr } = require('aleppo')\nisStr('hello', 'thanks for' , 'being here') // true\nisStr(1,2,3,4,5,6,7,100) // false\n```\n\n\u003ca name=\"isFn\" /\u003e\n\n### isFn(...inputs)\n\nChecks if function returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isFn } = require('aleppo')\nisFn(function () { return 'tiny  fnc' }) // true\nisFn(1,2,3,4,5,6,7,100) // false\n```\n\n\u003ca name=\"isArr\" /\u003e\n\n### isArr(...inputs)\n\nChecks if arrays returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isArr } = require('aleppo')\nisArr(['yeah'], [1,3], ['sure it is']) // true\nisArr(1,2,3,4,5,6,7,100, 'string') // false\n```\n\n\u003ca name=\"isZeroLength\" /\u003e\n\n### isZeroLength(...inputs)\n\nChecks if strings zero length returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isZeroLength } = require('aleppo')\nisZeroLength([], '', []) // true\nisZeroLength([1,2,3,4,5,6,7,100], 'string', [], '') // false\n```\n\n\u003ca name=\"isStrEmpty\" /\u003e\n\n### isStrEmpty(...inputs)\n\nChecks if strings are empty returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isStrEmpty } = require('aleppo')\nisStrEmpty('') // true\nisStrEmpty('not empty string') // false\n```\n\n\u003ca name=\"isArrEmpty\" /\u003e\n\n### isArrEmpty(...inputs)\n\nChecks if arrays are empty returns true otherwise returns false.\n\n__Examples__\n\n```javascript\nconst { isArrEmpty } = require('aleppo')\nisArrEmpty([]) // true\nisArrEmpty(['what do you think?']) // false\n```\n\nFunction execution - DOO\n------------------------\n\nExecutes multiple arguments with multiple functions in one call. Returns the results in required form.\nIt passes each argument to all functions, after it's done with the first argument, it moves to process the second argument, so on so forth.\n\n\u003ca name=\"npm_doo\" /\u003e\n\n```bash\n$ npm i aleppo.doo\n```\n\n\u003ca name=\"doo_iterator\" /\u003e\n\n### doo.iterator([...funcs], [...args])\n\nReturns [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) object of results.\n\n__Example__ : ```doo.iterator```\n\n```javascript\nconst { doo } = require('aleppo')\n// suppose we have two functions\nfunction  greetings (name) { return `hello ${name}` }\nfunction  bye (name) { return `goodbye ${name}!` }\n\nconst result =  doo.iterator([greetings, bye], ['Jimmy', 'Catherine'])\n// pass the first argument to the first function.\nresult.next() // { value: 'hello Jimmy', done: false }\n\n// pass the first argument to the second function.\nresult.next() // { value: 'goodbye Jimmy!', done: false }\n\n// done with first argument, pass the second one to the first function.\nresult.next() // { value: 'hello Catherine', done: false }\n\n// pass the second argument to the first function.\nresult.next() // { value: 'goodbye Catherine!', done: false }\n\n// done will be true when finishing\nresult.next() // { value: undefined, done: true }\n ```\n\n\u003ca name=\"doo_array\" /\u003e\n\n### doo.array([...funcs], [...args])\n\nReturns array of results.\n\n__Example__\n\n```javascript\n// continue working with same functions above\nconst result =  doo.array([greetings, bye], ['Jimmy', 'Catherine'])\nconsole.log(result);\n// will print\n[ 'hello Jimmy', 'goodbye Jimmy!', 'hello Catherine', 'goodbye Catherine!' ]\n```\n\n\u003ca name=\"doo_object\" /\u003e\n\n### doo.object([...funcs], [...args])\n\nReturns array of objects [{func: 'Function name', result: 'result of the function'}]\n\n__Example__\n\n```javascript\n// continue working with same functions above\nconst result =  doo.object([greetings, bye], ['Jimmy', 'Catherine'])\nconsole.log(result);\n// will print\n[\n  { func: 'greetings', result: 'hello Jimmy' },\n  { func: 'bye', result: 'goodbye Jimmy!' },\n  { func: 'greetings', result: 'hello Catherine' },\n  { func: 'bye', result: 'goodbye Catherine!' }\n]\n```\n\n\nTime and date\n-------------\n\nA set of functions to deal and manipulate with time and date.\n\n\u003ca name=\"delay\" /\u003e\n\n### Delay\n\nCalculates delay time according to given option then returns it in milliseconds.\n\n\u003ca name=\"npm_delay\" /\u003e\n\n```bash\n$ npm i aleppo.delay\n```\n\n```javascript\nconst { delay } = require('aleppo')\n```\n\n\u003ca name= \"delay_options\" /\u003e\n\n###### Types of options formats are:\n* ```year/years/yrs/y/yy/yyy/yyyy```: delay by years.   \n* ```d/dd/day/days```: delay by days.   \n* ```h//hr/hrs/hour/hours``` : delay by hours.   \n* ```w/week/weeks```:  delay by weeks.\n* ```mo/mos/month/months/mth/mths``` : delay by months.   \n* ```m/min/mins/minute/minutes```: delay by minutes.\n* ```s/sec/secs/second/seconds``` : delay by seconds.   \n* ```ms/mili/milisec/milisecs/milisecond/miliseconds``` : delay by milliseconds.  \n\n__Example__\n\n```javascript\nconst { delay } = require('aleppo')\n\ndelay('1h') //  3600000.\nsetTimeout(()=\u003e'hello from the other side', delay('10m') + Date.now());\n// will print hello form the other side after ten minutes from now.\n```\n\n\u003ca name=\"date\" /\u003e\n\n### Date:\n\nDeals with time and date, in readable form. It has nine major helper functions to compute time and date.\n\n\u003ca name=\"npm_date\" /\u003e\n\n```bash\n$ npm i aleppo.date\n```\n\n\u003ca name= \"date_now\" /\u003e\n\n#### date.now([, options])\n\nReturns current date or time format according to required option.\n  - ```options``` is String. [Here all valid options](#date_options).\n  - Default value is current local time.\n  - Date format can use one of the following [separators](#date_separators).\n  - ```now``` throws an error when options is not String or valid.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\n// default is local time.\ndate.now() // 6/17/2017, 3:00:03 PM\n\ndate.now('ts')\n// return current timestamp 1495989532977.\n\ndate.now('hr:day:mo:week') // 18:Sunday:5:21\n/*\n* hr --\u003e current hour\n* hr --\u003e current day\n* hr --\u003e current month\n* hr --\u003e current week\n* : --\u003e separator\n*/\n\ndate.now('year,day,week,month,second') // 2017:Sunday:21:May:52\n// same as above but more complex request and different separator.\n\ndate.now('year') // 2017\ndate.now('yy') // 17\ndate.now('mon') // 6\ndate.now('mth') // Jun\ndate.now('month') // June\ndate.now('wk') // 23\n```\n\n\u003ca name= \"date_later\" /\u003e\n\n#### date.later(Xoptions[, ts|fullDate])\n\nReturns later date or time according to required option. ```Later``` computes the difference of time accurately, taking into consideration year type and days count in each month.\n\n  - ```Xoptions``` is String. Combined of number of times with [valid options](#date_options). X is 1 by default.\n  - ```ts``` If you want to return value in timestamp, pass 'ts'.\n  - ```fullDate``` If you want to return full date object, contains { yr, mo, dy, hr, min, sec}\n  - Complex date format is not allowed.\n  - ```later``` throws an error when options is missing, not String or invalid.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\n/*\n* Today is  Sunday, June 18, 2017\n*/\n\ndate.later('10days') // Wednesday\ndate.later('10d') // 3\ndate.later('10dd') // Wed\n\ndate.later('2wk') // 26\ndate.later('2wk', 'ts') // 1499015984347\ndate.later('2wk', 'fullDate') // { yr: 2017, mo: 7, dy: 2, hr: 19, min: 20, sec: 0 }\n\ndate.later('12mo') // 6\ndate.later('12mth') // Jun\ndate.later('12month') // June\n```\n\n\u003ca name= \"date_ago\" /\u003e     \n\n#### date.ago(Xoptions[, ts|fullDate])\n\nReturns any required format for time or date happened ago from now. ```ago``` computes the difference of time accurately, taking into consideration year type and days count in each month.\n\n  - ```Xoptions``` is String. Combined of number of times with [valid options](#date_options). X is 1 by default.\n  - ```ts``` If you want to return value in timestamp, pass 'ts'.\n  - ```fullDate``` If you want to return full date object, contains { yr, mo, dy, hr, min, sec}\n  - Complex date format is not allowed.\n  - ```ago``` throws an error when options is missing, not String or invalid.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\n/*\n* let's try time here since we tried date above.\n* Today, time is 7: 30 PM\n*/\n\ndate.ago('hour') // 18\ndate.ago('hr24') // 18\ndate.ago('hr12') // 6: 30 pm\ndate.ago('2hr12') // 5:30 pm\ndate.ago('2hr12', 'ts') // 1497803572706\n```\n\n\u003ca name= \"date_readTs\" /\u003e\n\n#### date.readTs(timestamp)\n\nReturns readable timestamp object. Contains yr, mo, dy, hr, min, sec.\n  - ``timestamp`` can be Number or String.\n  - ```readTs``` throws an error when timestamp is missing or invalid.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\ndate.readTs(1503247105430)\n// returns\n{ yr: 2017, mo: 5, dy: 23, hr: 19, min: 15, sec: 45 }\n```\n\n\u003ca name= \"date_isLeap\" /\u003e\n\n#### date.isLeap([, year])\n\nReturns Boolean. True if the year is [leap](https://en.wikipedia.org/wiki/Leap_year). False for otherwise.\n  - Default value is current year.\n  - ```isLeap``` throws an error when year is not valid number or valid value.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\ndate.isLeap(2019) // false\ndate.isLeap(2000) // true\n\n// default is the current year 2017.\ndate.isLeap() // false\n```\n\n\u003ca name= \"date_isCommon\" /\u003e\n\n#### date.isCommon([, year])\n\nReturns Boolean. True if the year is [common](https://en.wikipedia.org/wiki/Common_year). False for otherwise.\n  - Default value is current year.\n  - ```isCommon``` throws an error when year is not valid number or valid value.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\ndate.isCommon(2028) // false\ndate.isCommon(2018) // true\n\n// default is the current year 2017.\ndate.isCommon() // true\n```\n\n\u003ca name= \"date_yearType\" /\u003e\n\n#### date.yearType([, year])\n\nReturns String of year type [common](https://en.wikipedia.org/wiki/Common_year) or [leap](https://en.wikipedia.org/wiki/Leap_year).\n  - ```year``` is Number\n  - Default value is current year.\n  - ```yearType``` throws an error when year is not valid number or valid value.\n\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\nconst date = getters.date\n\ndate.yearType(2000) // leap\n\ndate.yearType(1999) // common\n\ndate.yearType(2028) // leap\n\n// default is the current year 2017.\ndate.yearType() // common\n```\n\n\u003ca name= \"date_daysCountInMonth\" /\u003e\n\n#### date.daysCountInMonth([, monthNum] [, year])\n\nReturns number of days in required month. Taking into consideration whether the year is [common](https://en.wikipedia.org/wiki/Common_year), or [leap](https://en.wikipedia.org/wiki/Leap_year) to return the right number of days for February.\n  - ```monthNum``` and ```year``` are Numbers\n  - Default value for ```monthNum``` is current month number, ```year``` is current year.\n  - ```daysCountInMonth``` throws an error if:\n    - Month number is not correct.\n    - One of the input date is not valid number.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\n// February in common year\ndate.daysCountInMonth(2, 2018) // 28\n\n// February in leap year\ndate.daysCountInMonth(2, 2016) // 29\n\n// regular month number\ndate.daysCountInMonth(1, 2017) // 31\n\n// default, returns the current month(June) days for the current year(2017).\ndate.daysCountInMonth() // 30\n```\n\n\u003ca name= \"date_countBtw\" /\u003e\n\n#### date.countBtw(type[, [, from|timestamp] [, to|timestamp ]] [-i])\n\n```\ndate.countBtw(type)\ndate.countBtw(type, to)\ndate.countBtw(type, from, to, i)\n```\n\nComputes the difference between two dates and returns objects of results.\n\n  - ```type``` is type of request, all/year/month/week/day. All relevant [options](#date_options) are valid.\n  - ```from``` String or Number.\n    * Default value is 1/1/currentYear.\n    * String for date format request should be \"dd/mm/yyyy\".\n    * Number will be explained according to request type.\n     * If your request type is ```year``` number will be converted to 1/1/year.\n     *  ``month`` to 1/month/currentYear. ```day``` to day/1/currentYear.\n  - ```to``` String or Number. Same as ```from``` with major difference. ```to``` converts number to current date instead of beginning of the year.\n    * Default value is currentDay/currentMonth/currentYear.\n    * If your request type is ```year``` number will be converted to: currentDay/currentMonth/year.\n    * ``months`` to currentDay/month/currentYear. ```day``` to day/currentMonth/currentYear.\n  - ```i``` A flag constiable, false by default. If you want to include the last day in the result, pass 'i' to include it.\n  - returns object of request type and remainder of calculations if there is any.\n\n  Note:\n  - Both ```from``` and ```to``` accepts timestamp as numbers.\n  - One date argument is considered as ```to```.\n  - Date format can use one of the following [separators](#date_separators).\n  - ```countBtw``` throws an error if:\n    - No type is provided.\n    - One of the input date is not valid.\n    - Type of request is not valid or missing.\n\n__Example__\n\n```javascript\nconst { date } = require('aleppo')\n\ndate.countBtw('yrs')\n// returns:\n { years: 0, months: 5, days: 15 }\n /*\n * since there is no from and to.\n * from will be: 1/1/2017\n * to will be now: 16/6/2017 (current date)\n * returns object of all forms since no specific type was entered.\n */\n\ndate.countBtw('yrs', 2017)\n// returns:\n { years: 0, months: 5, days: 15 }\n/* same result as above.\n* one date argument is to.\n* number with year it means year number.\n* year number will be converted tp date form including now parameters.\n* 2017--\u003e 16/6/2017 (current month and day date)\n* from of course  1/1/2017\n*/\n\ndate.countBtw('yrs', 2017, 2050, 'i')\n// returns\n{ years: 33, months: 5, days: 16 }\n/* from : 2017--\u003e 1/1/2017\n* to : 2015--\u003e 16/6/2050 (current month and day date)\n* i: include last day 16/6/2050\n*/\n\ndate.countBtw('yrs', '13/5/2089', '1/1/2010')\n// returns\n { years: 79, months: 4, days: 12 }\n\n// let's pass timestamp for \"Thu, 01 Jun 2017 17:21:31 GMT\"\n// which it's 1496337691025\n date.countBtw('yrs', '1.1.1990', 1496337691025)\n // returns\n { years: 27, months: 5, days: 0 }\n\n\ndate.countBtw('mos')\n// returns:\n{ months: 5, days: 15 }\n/*\n* default:\n* from --\u003e 1/1/2017\n* to --\u003e 16/6/2017 (current year and day date)\n*/\n\ndate.countBtw('mos', 10)\n// returns:\n{ months: 9, days: 15 }\n/*\n* default from is 1/1/2017\n* converted to is 16/10/2017 (current year and day date)\n*/\n\ndate.countBtw('mos', 10, 12, 'i')\n// returns:\n{ months: 2, days: 16 }\n/*\n* default from is 1/10/2017\n* converted to is 16/12/2017 (current year and day date)\n* plus one day because of i - include last day\n*/\n\ndate.countBtw('mos', '13/5/2089', '1/1/2010')\n// returns:\n { months: 952, days: 12 }\n\ndate.countBtw('day')\n// returns\n{ days: 166 }\n/*\n* default:\n* from --\u003e 1/1/2017\n* to --\u003e 16/6/2017 (current year and day date)\n*/\n\ndate.countBtw('day', 10)\n// returns\n{ days: 174 }\n/*\n* default from is 1/1/2017\n* converted to is 10/6/2017 (current month and day date)\n*/\n\ndate.countBtw('d', '13/5/2089', '1/1/2010')\n// returns:\n{ days: 28987 }\n\ndate.countBtw('weeks', '1/1/2010', '1/1/2011')\n// returns:\n{ weeks: 52, days: 1 }\n\ndate.countBtw('all', '1/1/2010', '18/9/2031')\n// returns object difference:\n{\n  inDays: 7930,\n  inWeeks: { weeks: 1132, days: 6 },\n  inMonths: { months: 260, days: 17 },\n  inYears: { years: 21, months: 8, days: 17 }\n}\n```\n\n\u003ca name= \"date_options\" /\u003e\n\n###### Available options format:           \n\n* ```year/years/yrs/yyyy```: full year/ four digits.\n* ```y/yy/yyy```: two digits year.\n* ```mo/mon/mos/mons```: month number.      \n* ```mth/mths```: month short name.   \n* ```month/months```: month full name.   \n* ```w/wk/week/weeks```: week number.\n* ```d```: day number in the week.\n* ```dd```: day short name.   \n* ```day/days```: day full name.   \n* ```h/hr/hrs/hour/hours/h24/hr24/hrs24/hour24/hours24``` : 24-hour form.   \n* ```h12/hr12/hrs12/hour12/hours12```:  12-hour form.\n* ```m/min/mins/minute/minutes``` : minutes.   \n* ```s/sec/secs/second/seconds``` :  seconds.   \n* ```ms/mili/milisec/milisecs/milisecond/miliseconds``` : milliseconds.   \n* ```ts/timestamp```: timestamp. (available only for now function)  \n* ```local``` : local date and time. (available only for now function)  \n* ```local date/localDate``` : local date.(available only for now function)  \n* ```local time/localTime``` : local time.  (available only for now function)\n* ```utc``` : UTC time.  (available only for now function)\n\n\u003ca name= \"date_separators\" /\u003e\n\n###### Types of valid separators are:\n\n* ```-```  or  ```/```  or  ```.```  or  ```:```  or  ```,```  or  ```\u003cspace\u003e```\n\nTests\n-----\n\n```sh\n$ npm test\n```\n\nLicense\n-------\n\nThis project is licensed under the [MIT License](https://github.com/Jimmy02020/aleppo/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalal246%2Faleppo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalal246%2Faleppo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalal246%2Faleppo/lists"}