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

jsondb-but-worse

v0.2.0

Published

[![npm version](https://badge.fury.io/js/jsondb-but-worse.svg)](https://badge.fury.io/js/jsondb-but-worse)

Downloads

2

Readme

JSONDB, but worse

npm version

This project is the result of a misguided attempt to create a kind of JSON database API for, well, data storage, stored as JSONs.

It is a very small, short project, which should get the job done. The simple idea is, extend the ObjectDB class, and build on top of the write/load functions. They are fairly simple, and self-explanatory (I hope).

Technical Details

Data objects, or objects meant to be stored in the DB, must extend class JSONData, which guarantees the existence of the toJSON() function. Any JSONData classes must also be prepared to accept a JSON in the constructor, as this is the construction used in order to load JSON objects from file to memory.

The code should clear this up, in case this doesn't make sense. The end result would be to simplify the code to something like:

db.saveData(records, './data', 'records.json')

And of course, you can extend the ObjectDB class and build any OOP abstractions to simplify the above as you like (such as setting default directory and filenames).

Developing

To test which files will be published, please use the script written instead of npm pack to allow for correct packing. These have been conveniently placed in npm scripting under the following: npm run n-pack npm run n-publish

And an additional convenience command: npm run clean

will simply delete the .tgz left behind by n-pack.

Advice

I really don't recommend you use this, it is flawed and very underdeveloped, but if you enjoy the attempted simplicity for any reason, knock yourself out. However, if you are a rational being, I highly suggest you use something actually good like LevelDB.

Contributions

Any pull requests to this would be interesting, since I'm curious to see how this can be added to/changed in terms of design, lolol.