Giter Club home page Giter Club logo

crush's Introduction

Crush

dude. duuude. focus dude. duuude. oh! so, hey dude. LOL!!!

A simple, self-contained, serverless, zero-configuration, json document store.

Crush sandboxes the current working directory similar to SQLite. The crush data directory is named crush.data by default, and each json document is saved pretty printed as a uuid.

While this is not the speediest of storage soultion it is simple - with the benefit that all data is stored as plain text in the file system.

Configuration

You may optionally set the path to the data directory. It defaults to $TMPDIR/cursh.data but can manually be set with the CRUSH_DATA_DIR environment variable.

# default
export CRUSH_DATA_DIR="$TMPDIR"/crush.data

# manually set the data directory path
export CRUSH_DATA_DIR=/tmp/crush.data

Commands

set

set <json> - Writes a json document and returns the document id

➜ crush set '{"name":"John Doe","active":true,"permissions":{"read":true,"write":false}}'
666B81D6-3F8A-4D57-BA3F-11FA8FC47246

get

get <document-id> - Retrieves a json document by document id

➜ crush get 666B81D6-3F8A-4D57-BA3F-11FA8FC47246
{
    "active": true,
    "name": "John Doe",
    "permissions": {
        "read": true,
        "write": false
    }
}

count

count - Total number of json documents in the database

➜ crush count
293

delete

delete <document-id> - Deletes a json document by document id

➜ crush delete 666B81D6-3F8A-4D57-BA3F-11FA8FC47246

drop

drop (--force) - Drops the database

➜ crush drop
Drop database '/tmp/crush.data'? [Y/n] Y
➜ crush drop --force

help

help - Displays help

➜ crush help
A simple, self-contained, serverless, zero-configuration, json document store.

Usage: crush [options] {count | delete | drop | get | help | set | version}

Available commands:
    count             Total number of json documents in the database
    delete            Deletes a json document by document id
    drop              Drops the database
    get               Retrieves a json document by document id
    help (*)          Provide help for individual commands
    set               Writes a json document and returns the document id
    version           Show the version of the program

Options (take precedence over global options):
    -v, --version                    Show the version of the program

Global Options:
    -h, --help                       Show help

version

version - Displays the current version

➜ crush version
A simple, self-contained, serverless, zero-configuration, json document store.
crush 0.0.0

Support, Bugs, And Feature Requests

Create issues here in GitHub (https://github.com/vijayparikh/crush/issues).

Versioning

For transparency and insight into the release cycle, and for striving to maintain backward compatibility, crush will be maintained under the semantic versioning guidelines.

Releases will be numbered with the follow format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch)
  • New additions without breaking backward compatibility bumps the minor (and resets the patch)
  • Bug fixes and misc changes bumps the patch

crush's People

Contributors

vijayparikh avatar

Stargazers

Ben Ziegler avatar

Watchers

 avatar  avatar James Cloos avatar Ben Ziegler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.