@otters/valve
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@otters/valve

Public npm package for Valve.

Basic Usage:

import {Valve} from '@otters/valve';

const valve = new Valve('my-api-key');

// Add a new email on to the end of the waitlist
await valve.addEmail('hi@alistair.sh');

// Get a record of all emails. Values are the unix
// timestamp that they were added at.
const emails = await valve.getAllEmails();
const joinedAt = new Date(emails['hi@alistair.sh']);

// Get a single email
const email = await valve.getEmail('hi@alistair.sh');
email.joinedAt; // unix timestamp
email.rank; // the position in the waitlist

// Peek the next email in the waitlist
const nextEmail = await valve.peekNextEmail();

// Remove and return the next email in the waitlist
const nextEmail = await valve.popNextEmail();

// Remove a specific email from the waitlist
await valve.removeEmail('hi@alistair.sh');

Package Sidebar

Install

npm i @otters/valve

Homepage

otters.app

Weekly Downloads

1

Version

1.1.1

License

none

Unpacked Size

7.45 kB

Total Files

5

Last publish

Collaborators

  • aabbccsmith