1.1.5 • Published 7 months ago

custom-datastore v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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.

1.1.5

7 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

2 years ago