GithubHelp home page GithubHelp logo

zaleskir / lev Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heapwolf/lev

0.0 2.0 0.0 604 KB

A commandline tool and repl (with autocomplete) for querying and managing leveldb instances.

lev's Introduction

SYNOPSIS

Commandline LevelDB management.

FEATURES

  • Command line data management
  • Interactive data management
  • REPL features auto-complete and suggestions for keys.
  • REPL automatically saves and reloads REPL history.
  • Connect to a network enabled database via multilevel.

INSTALLATION

$npm install lev -g

CLI EXAMPLES

$ lev

Get the first 10 keys in the database, the path is optional but if ommited a database will be created in the current working directory.

$ lev path/to/db --keys --limit 10

or short hand

$ lev path/to/db -kl 10

Get the first ten records starting at bazz and ending at zomg.

$ lev path/to/db --limit 10 --start 'bazz' --end 'zomg'

Get the key welcome from inside the 2 sublevels deep

lev ./db --cd greetings/en --get 'welcome'

For connecting to a multilevel enabled instance, specify the port parameter:

lev --port 1337 --keys ...

REPL

Start the REPL by providing only a path or host and port

$lev path/to/db

Commands in the REPL also match the API. But wait! There are a subset of commands that make common operations faster, easier and more fun. The following keys and sublevels are arbitrary and for the purpose of this example only.

ls A listing of keys in the current sublevel

Supports tab completion, same as the javascript function.

>ls
81!6dfb2cf92a411302b97a24cb977c1bd981711c
81!8613357d10da3ae2d295a53137b750d6b324b5
c9!25e7700452f8f269898cee9c18925350a6ef24
8c!699404e9c54349c32f4ca88a9ceea9382cffe9
>

get Get the value of a key and inspect it if possible

Supports tab completion, same as the javascript function.

>get 81!6dfb2cf92a411302b97a24cb977c1bd981711c
'{ "greeting": "hello, world!" }'
>

cd create or change into a sublevel

Supports cd .. to navigate down a level. cd / to navigate to the root of the database. And cd foo/bar/bazz to navigate up to a deeply nested sublevel in the database.

>cd 97a24cb977c1bd9
/97a24cb977c1bd9>ls
c9!b5db29d11c6556b7d5b7ffe272dcefec9edae6

Default Configuration

You can create a .lev file in your home directory and it will be used to set the defaults. Command line arguments will override the default settings in this file.

{
  "createIfMissing": true,
  "encoding": "json"
}

lev's People

Contributors

heapwolf avatar no9 avatar juliangruber avatar brycebaril avatar robertkowalski avatar

Watchers

James Cloos avatar  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.