tauist
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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.0

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

Package Sidebar

Install

npm i tauist

Weekly Downloads

72

Version

1.1.2

License

MIT

Unpacked Size

5.5 kB

Total Files

5

Last publish

Collaborators

  • camsjams