New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

temptrax

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

temptrax

Generate entries with expiration date

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Contributors Issues MIT License


Temptrax

About Temptrax

Temptrax is a Node.js module that allows you to generate entries which are valid for a specific amount of time. It was built with Postgresql as the storage but it also has an in-memory support. Built for Protonfile

Installation

Install the package with npm

npm install temptrax

Usage

import Temptrax from 'temptrax';

const expirationDate = new Date('Sun May 11,2025'); // this entry will expire on May 11, 2025

const temptrax = new Temptrax({
	databaseUrl: 'postgres://username:password@host:5432/dbname',
	tableName: 'temptrax',
	inMemory: false,
});
// databaseUrl and tableName not required if inMemory is true

await temptrax.add('entry_id', { key: 'value' }, expirationDate);

// Get the entry at some later point in time
try {
	const entry = await temptrax.get('entry_id');
} catch (error) {
	// entry is expired or doesn't exist
}

Contributing

Any contributions you make are greatly appreciated.

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/MyFeature)
  • Commit your Changes (git commit -m 'Add MyFeature')
  • Push to the Branch (git push origin feature/MyFeature)
  • Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Keywords

Postgresql

FAQs

Package last updated on 28 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts