Skip to content

Tau provides a list of constants for use in cache expiration or TTLs.

License

Notifications You must be signed in to change notification settings

camsjams/node-tauist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tauist: node time constants

Tauist provides a list of constants for use in cache expiration or TTLs.

Tau is the time constant of any device, such as an RC circuit.

Current Version 1.1.2

Version 1.1.0 adds TypeScript definitions

Platforms / Technologies

Install

  $ npm install tauist --save

There are two objects exposed

var tauist = require("tauist");
// seconds
tauist.s;

// milliseconds
tauist.ms;

Usage

// load into your script
var tauist = require("tauist");

// use in your caching layers

// example: express static
app.use(express.static(__dirname + "/public", { maxAge: tauist.ms.oneDay }));

// example: Node redis (npm install redis)
client.expire("my:key:here", tauist.s.oneHour);

// apply directly to the forehead

Current available times

  • halfMinute
  • oneMinute
  • fiveMinutes
  • tenMinutes
  • thirtyMinutes
  • oneHour
  • twoHours
  • threeHours
  • fourHours
  • fiveHours
  • sixHours
  • oneDay
  • twoDays
  • sevenDays
  • thirtyDays
  • sixMonths

About

Tau provides a list of constants for use in cache expiration or TTLs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published