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

catacomb

v0.1.3

Published

A bare bones database. (Haha, get it?)

Downloads

44

Readme

Catacomb

A bare bones JSON database.

Note: As of 2017-06-12, Catacomb is still in the early stages of development. Please avoid using it and check back later.

About

I wanted a simple way to store my Electron app's data. The obvious solution was just to use the FS module to write JSON to disk. So that's what Catacomb does. Only, it includes some slightly more "databasey" methods in case you want to search your JSON instead of referencing a specific key-value pair.

Also, I found most other databases recommend for Electron projects:

  • Too complicated to set up.
  • Requiring usage within the rendering process because they used IndexedDB (and this is not what the rendering process is for).
  • Focusing too much on syncing and online integration which is super handy if you need it, but adds a lot of overhead on offline-only Electron apps that just need a way to save user data between sessions.

If you find yourself asking, "Why does this even exist? It's barely worth a module!", well I did say it was "bare bones." Also, on a personal level, I wanted to try writing an open source module and publishing it on NPM, just for the thrill. So there's that.

Installation

You can install Catacomb NPM style and require() it (preferred), or use HTML script tags.

NPM

Nothing special here, install it like any other module:

npm install catacomb --save

After installing, simply require it in your code:

const Catacomb = require("catacomb");

HTML Script Tags

In the near future, it will be possible to download compiled and minified versions to include in HTML <script> tags. After downloading and unzipping the release, move to to your project and in your HTML file, include it thusly:

<html>
	<head>
		...
		<script src="js/catacomb.min.js"></script>
		...
	</head>
	<body> ... </body>
</html>

Usage (Work in Progress)

Full documentation can be found on the Github Wiki.

Here's a little example of how straight forward it is to use Catacomb:

// Create a catacomb and specify some options:
let library = new Catacomb({
	index: "id" // This is the key used as an index.
});

// Save to Electron's user data folder:
library.save( app.getPath("userData") + "/library.json");

// Stick a new record in. In this case, we provide the UUID because it's linked to something specific in our app. If it was not provided, Catacomb will generate a UUID itself, and return it.
library.insert({
	id: "0399afa4-219f-45ea-aae0-6968d59a9028",
	name: "Dooper"
});

// Out of curiosity, how many records does our library have?
console.log( library.getSize() );

// Persist our library to disk:
library.save();