npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jabberwocky-labs/ts-db

v0.0.1

Published

<h1 align="center">Jabberwocky Labs - TypeScript</h1> <p align="center"> <a href="https://www.npmjs.com/package/@jabberwocky-labs/ts-db" target="_blank" > <img src="https://img.shields.io/npm/v/@jabberwocky-labs/ts-db.svg?color=white&style=for-t

Downloads

2

Readme

The home of Jabberwocky Labs' TypeScript community code. For now, this codebase will focus on our database product, however, this will be expanded to support additional Jabberwocky Labs products as well as non-product, open-sourced TypeScript projects.

⬇️ Install

Run the following command at the root of your project:

Yarn

yarn add @jabberwocky-labs/ts-db

NPM

npm install @jabberwocky-labs/ts-db

📘 Terminology

Space

A space can be thought of as an independent timeline of your databases records. Spaces reference shared locations for the used primitives allowing for non-duplicated values across spaces. The value My awesome string will only exist once across your spaces. However, in your usage of spaces, they operate as isolated environments. In the future, we will be adding extended functionality to allow for spaces to branch from, merge together, and stream to one another.

Example:

You may have both a production space and a development space to allow you to work locally without affecting production data. With this setup, you may periodically clone the production space over the development space so that you can safely test/build with your production data. Because the values of your space need not be cloned, just the architecture of it, this clone will happen in microseconds.

Class

A class is a means of classifying your data. Some example classes may be firstName, emailAddress, or phoneNumber.

Value

A value is a primitive type:

  • null
  • boolean
  • string
  • number
  • float

Item

An item is the unique combination of a class and value within a space. An item can have sub items which you interact with like you would record properties in other databases. The key difference here is that an item only exists once and using it as a property creates a relationship between data.

🔧 Setup

All requests are run through the JabberwockyDBClient

import { JabberwockyDBClient } from '@jabberwocky-labs/ts-db';

const client = new JabberwockyDBClient();

You can authenticate by directly passing your token:

const client = new JabberwockyDBClient({ token: 'xxxxxxx' });

However, the recommended method is to set the JW_TOKEN environment variable using a tool like dotenv or via node directly:

JW_TOKEN=xxxxxxx node index.js

🚀 Usage

Account

Initiate Account Client

const account = client.account(123456);

Space

Initiate Space Client

const productionSpace = account.space('production');

Check Existence

const doesExist = await productionSpace.exists();

Ensure Not Existing

await productionSpace.ensureMissing();

Class

Initiate Class Client

const emailClass = productionSpace.class('email');

Check Existence

const doesExist = await emailClass.exists();

Ensure Not Existing

await emailClass.ensureMissing();

Item

Initiate Item Client

const zachsEmails = emailClass.item('[email protected]');

Check Existence

const doesExist = await zachsEmails.exists();

Ensure Not Existing

await zachsEmails.ensureMissing();