1.0.5 • Published 4 years ago

expired-hours v1.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Expired Hours

this module allows you to write the time you want it to expire

import module

const {time} = require("expired-hours")

how use this

const {time} = require("expired-hours")

let hour_expired = time(3) //this add how many hours expired and return hour and date expired

console.log(hour_expired) //{ hV: '3:20 AM', dV: '08/27/2020' }

Can also be used to terminate sessions in React js or front-end

const {timeExpired,expired} = require("expired-hours") //import in constant

let hour_expired = timeExpired(3) //this add how many hours expired and return hour and date expired in json Stringify for save in localStorage

localStorage.setItem('mydata',hour_expired)//SAVE in local starage for finish session

//and to end the session
if (expired(localStorage.getItem("token"))){
    //expired session and redirect LOGIN
}else{
    //active session
}
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago