Socket
Book a DemoInstallSign in
Socket

lev

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lev

CLI/REPL/TUI for levelDB/Nodebase

Source
npmnpm
Version
2.1.4
Version published
Weekly downloads
4
-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

SYNOPSIS

Complete LevelDB management for your terminal.

FEATURES

  • A Terminal User Interface
  • REPL with colorized auto-complete and key suggestions
  • REPL automatically saves and reloads REPL history
  • Scriptable from the command line
  • Connect to local or network enabled instances

INSTALLATION

$npm install lev -g

TUI

This is the mode entered when you type lev with no arguments. I recommend a modern terminal program like iTerm2 on OSX or [urxvt] on Linux.

On the left you have a list of keys, on the right you have the selected value. You can edit the selected value by clicking on it. Save the modified value by pressing control+s.

img

img

img

CLI

The CLI mode is useful for bash scripting. Here's an example where we get the first 10 keys in the database.

$ lev path/to/db --keys --limit 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 and manifest parameters...

lev --manifest path/to/manifest.json -a 127.0.0.1:1337 --keys ...

REPL

Provide just a path and no flags to start the REPL.

$lev path/to/db

ls List the keys in the current range.

img

start [string]

Sets the start of the current range. When createReadStream() is created on the current sublevel (or root) it will use this value as a parameter.

end [string]

Sets the lower bound of the current range

limit [number]

Limits the number of results in the current range

reverse

Reverse the results in the current range

get [string]

Get a value from the current range

cd [string]

Set the current sublevel

Supports cd .. to navigate down a level. cd / to navigate to the root of the database. And supports paths cd foo/bar/bazz.

USER SETTINGS

A .lev file will be created in your home directory. You can manage this with the TUI or by hand.

{
  "query": {
    "start": "",
    "end": "",
    "reverse": false,
    "limit": 1000
  },
  "key": null,
  "connections": {
    "Default":{
      "path":"",
      "keyEncoding":"utf8",
      "valueEncoding":"json",
      "local":true,
      "compression":true,
      "cacheSize":8388608
    }
  }
}

License

MIT

Keywords

leveldb

FAQs

Package last updated on 08 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts