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 🙏

© 2025 – Pkg Stats / Ryan Hefner

market-db

v0.0.20

Published

Electron module that could be used for storing market data in json based database tables

Downloads

59

Readme

market-db


Flat file market database solution for electron and other Nodejs apps.

market-db is an npm library that let you simplify database creation and operation on a json file, for storing market data.

The db is market-data aware. So, you'll be able to store stock, options and quotation data using the api provided by the library.

The json file is saved on the application folder. The user also has the option to save the database table anywhere they chose.

The table format contained in the table_name.json should be in the form of

{
  "table_name": [
    {
      "field1": "Value of field 1",
      "field2": "Value of field 2",
      ...
    }
  ]
}

Important: The script that uses this library should be run with electron command first in order to create the directory on the user data folder (when not using a custom directory for the database). The name that will be used for the app directory will be what was indicated in the package.json as name. If this is not set, the name property will be used.

Installation

The preferred way of installation is to install it locally on the application.

npm install market-db --save

Init Database

Creates multiple tables [table-name].js inside the application userData folder.

In Windows, the application folder should be in C:\Users\[username]\AppData\Roaming\[application name]


const db = require('market-db');
const { app, BrowserWindow } = require("electron");

db.initDB('customers')
    .then((result) => {
        // result handler here
    })
    .catch((error)=> {
        // error handler here
    });

/*
	Output:
    	Success: true
        Message: Success!

	Result file (customers.json):
    {
    	"symbols": [
            {
                "symbol": "TSLA",
                "name": "TSLA Inc."
            }
        ]
    }
*/

TBD: To be updated

For contributions, please see the CONTRIBUTE.md file. Thank you.