project-uptime
An simple NPM package that lets you know How long your Project is Online
Installation
npm i project-uptime
project-uptime
is working at Node v4+
Documentation
A lot of endpoints are works Normal.
Main Function [Very Required]
Method | Description | Parameters | Returns |
---|---|---|---|
startRecord | Start/Resume Recording Your Project Uptime | - | - |
pauseRecord | Pause the Records. This doesn't Reset your Records. | - | - |
resetRecord | Reset all your Records to 0 | - | - |
Records (Start after records
)
Method | Description | Parameters | Returns |
---|---|---|---|
second | Gets your Second Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Second Records |
minute | Gets your Minute Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Minute Records |
hour | Gets your Hour Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Hour Records |
day | Gets your Day Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Day Records |
week | Gets your Week Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Week Records. |
month | Gets your Month Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime ;) | - | Returning your Month Records. |
year | Gets your Year Records, Feel free for Customize your own design for Logging & Showing Record of your Uptime | - | Returning your Year Records. |
all | Gets All Of Your Uptime Records. | - | Returning all of Your Records. |
short | Telling your Uptime by returning Short Information. | - | Returns an Short Uptime Records |
NoFilter (Starts after NoFunction
)
NoFilter is an Function where The User can gets The Uptime Records without any Cutted Result. example, When Passed 1 Minute, The Output of NoFilter Second is 60
Which means 60 Second
.
Method | Description | Parameters | Returns |
---|---|---|---|
second | Gets your Second Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime. But that's Not CUTTED-OFF after 1 Minute Passed. So it keeps counting to 61, 62, and Above. | - | Returning your Second Records without Filter. |
minute | Gets your Minute Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime. But that's not Filtered, So when 1 Hour passed, The Minute NoFiltered Output is 60 Which means 60 Minute, And keeps continue to 61, 62 and Above |
- | Returning your Minute Records without Filter. |
hour | Gets your Hour Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime, But that's NoFilter | - | Returning your Hour Records without Filter |
day | Gets your Day Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime, But that's not Filtered. | - | Returning your Day Records without Filter |
week | Gets your Week Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime, But not Filtered ;) | - | Returning your Week Records without Filter. |
month | Gets your Month Records, Feel free for Customize your own design for Logging & Showing Records of Your Uptime, But not Foltered;) | - | Returning your Month Records without Filter. |
By the way, NoFilter Is not have Years NoFilter Record because YEAR records is already No Filtered, And that's Impossible if Project can Uptime at 23-98 Year.
Setup
- Let's begin the setup, But first, Let's Create an Variable
const projectuptime = ;
And last, Let's Start Record your Uptime
projectuptime
Let's see your Uptime, But we suggest you for Use short
projectuptimerecords;
Output when your Project is Running at 30 Second
30 Second
Output when your Project is Running at 5 Minute
50 Minute
And keeps Recording 24/7.
Example & Output
-Example 1
- Showing All Records Information
const projectuptime = ; // Lets Make it keeps Showing the Records; //Let's start Recordingprojectuptime
Output When runs 9 Hour:
0 Year : 0 Month : 0 Week : 0 Day : 9 Hour : 48 Minute : 32 Second
- Example 2
- Customing your own Design
const projectuptime = ; //Let's Make Variablevar record = projectuptimerecords; var second = record;var minute = record;var hour = record;var day = record;var week = record;var month = record;var year = record;//Make Blank Variablevar uptime;// Lets Make it keeps Showing the Records ; projectuptime;
Output when Project Running at 5 Month
0 Year : 5 Month : 23 Day
Community
Any question or Doubt can Join our Discord Server.