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

custom-datastore

v1.1.5

Published

Builds database system from the scratch. You can own it by having the datastore customized

Downloads

16

Readme

custom-datastore

npm   npm   GitHub issues   GitHub User's stars   GitHub followers   Twitter Follow   Twitter URL

A database system application. House the database collection in a customized datastore in JSON format. It currently accepts inputs from the user via the command-line argument, parse it, and process it by either generating a database in the datastore, removing, or retrieving a particular datum or set of data.

Table of content

1. Features

  • Add a datum to the database
  • Read a datum from the database
  • Read all data from the database
  • Remove a datum from the database
  • Generate database in file
  • Guide to usage

2. Installation

After you've created your project using npm init, go ahead and run:

npm install custom-datastore

3. Usage

After the successful installation from the previous section, head on to your app file and enter the following code:

const {database} = require('custom-datastore')
database()

Then head on to the terminal and proceed to the usage below. Note that if there is space inbetween the value of the flag, you will need to wrap it in quote. Wrapping in single quote will fail on windows, but not on linux or OSX. So ensure you wrap with double quote when using windows. Using any of the command in each section below will work. Ensure you change <appFile> in the commands to the name of your app file.

3.1. Adding a datum to the database

node <appFile>.js add --title title-of-data --body body-of-data

node <appFile>.js add --title "title of data" --body "body of data"

node <appFile>.js add --title=title-of-data --body=body-of-data

node <appFile>.js add --title="title of data" --body="body of data"

3.2. Reading a datum from the database

node <appFile>.js read --title title-of-data

node <appFile>.js read --title "title of data"

node <appFile>.js read --title=title-of-data

node <appFile>.js read --title="title of data"

3.3. Reading all data from the database

node <appFile>.js list

3.4. Removing a datum from the database

node <appFile>.js remove --title title-of-data

node <appFile>.js remove --title "title of data"

node <appFile>.js remove --title=title-of-data

node <appFile>.js remove --title="title of data"

3.5. Generating database in file

node <appFile>.js generate --datastore name-of-datastore

node <appFile>.js generate --datastore "name of datastore"

node <appFile>.js generate --datastore=name-of-datastore

node <appFile>.js generate --datastore="name of datastore"

3.6. Guide

For general guidance including the available commands, and what each of the commands do, use the command:

node <appFile>.js --help

For guidance on the use of each command, including the option they take, use the command:

node <appFile>.js [command] --help

4. Example

4.1. Adding a datum to the database

4.1.1. Success response

d-add-success

4.1.2. Error response

This error occurs when you try to add a data with an existing title to the database

d-add-error

4.2. Reading a datum from the database

4.2.1. Success response

d-read-success

4.2.2. Error response

This error occurs when you try to read a datum that does not exist in the database.

d-read-error

4.3. Removing a datum from the database

4.3.1. Success case

d-remove-succes

4.3.2. Error case

This error occurs when you try to remove a datum that does not exist in the database

d-remove-error

4.4. Reading all data from the database

4.4.1. Success case

d-list-success

4.4.2. Error case

This error occurs when you try to read all data from an empty database

d-list-error

4.5. Generating database in file

4.5.1. Success case

d-generate

5. Technology

Node.js

6. Contribution guide

  1. Open up a new issue, and describe the feature you want to contribute.

  2. Fork this repository, then clone it to your local machine and open it in your editor of choice.

  3. Create a new branch for your task, and add a descriptive branch name using the git command: git checkout -b (branch name)

  4. After implementation, commit your changes with a descriptive commit message, the commit message should give an idea of the feature you worked on, use the git command: git commit -m "commit message"

  5. Push changes to your forked repo with the new branch you created using the git command: git push origin your-branch-name

  6. Create a pull request to the develop branch of this repository from your forked repo on github.