Skip to content

hharzer/key-value-timestamp-datastore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key-Value-Timestamp Challenge

A CLI tool to perform data manipulations to a JSON data store.

Requirements

Install

  • Clone repo: git clone git@github.com:agdavid/key-value-timestamp-datastore.git
  • npm install

Usage

📌 node index.js <COMMAND NAME> [OPTIONS] 📌
$ node index.js --help

$ node index.js add --key=<someStringKey> --value=<someStringValue>

$ node index.js find --key=<someStringKey>

$ node index.js find --value=<someStringValue>

$ node index.js find --timestamp=<someNumberTimestamp>

$ node index.js remove --key=<someStringKey> --timestamp=<someNumberTimestamp>

$ node index.js list

Commands

1. Help | --help

Description:

Get basic usage info for all provided CLI scripts.

Usage:
node index.js --help

or

node index.js -h

2. Add | add

Description:

Add object to the JSON data store.

Usage:
node index.js add --key=<key> --value=<value>
Options:
  • <key> | Required
  • <value> | Required

3. Find | find

Description:

Find objects in the JSON data store that match the provided optional parameters.

Usage:
node index.js find --key=<key> --value=<value> --timestamp=<timestamp>
Options:
  • <key> | Optional | Key of the JSON objects to locate.
  • <value> | Optional | Value of the JSON objects to locate.
  • <timestamp> | Optional | UNIX timestamp of JSON objects to locate.
Notes:
  • If no <key|value|timestamp> are provided, command will return all objects in JSON data store.

4. Remove | remove

Description:

Remove object matching the required key and timestamp parameters

Usage:
node index.js remove --key=<key> --timestamp=<timestamp>
Options:
  • <key> | Required
  • <timestamp> | Required

Demo

Stripe Key-Value-Timestamp Challenge

Contribute

Develop

  • Run node index.js <command_name> [options] to test various commands/options.
  • Write code!
  • Please use git-flow and commit your changes on a feature branch, rebase it on develop branch before finishing the feature, then issue pull request to develop branch

About

A Node CLI tool to perform data manipulation to a JSON data store.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%