Skip to content

Commit 707813f

Browse files
committed
readme: cleaning
1 parent 6948431 commit 707813f

File tree

2 files changed

+80
-41
lines changed

2 files changed

+80
-41
lines changed

README.md

Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,116 @@
1-
# STATUS
1+
# lev
22

3-
[![development sponsored by voltra.co](https://img.shields.io/badge/Development%20sponsored%20by-Voltra.co-yellow.svg)](https://voltra.co/)
4-
5-
# SYNOPSIS
63
A simple and convenient commandline tool and REPL for [`leveldb`](http://leveldb.org/).
74

8-
# FEATURES
9-
- REPL with colorized tab-completion and zsh/fish style key suggestions
10-
- REPL automatically saves and reloads REPL history
5+
## Features
6+
* [REPL](#repl-commands)
7+
* with colorized tab-completion and zsh/fish style key suggestions
8+
* automatically saves and reloads REPL history
9+
* [CLI](#cli-commands)
1110

12-
# SCREENSHOT
1311
![screenshot](/docs/screenshot.png)
1412

15-
# INSTALLATION
13+
## Summary
14+
15+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
16+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
17+
18+
19+
- [Installation](#installation)
20+
- [REPL commands](#repl-commands)
21+
- [GET &lt;key&gt;](#get-ltkeygt)
22+
- [PUT &lt;key&gt; &lt;value&gt;](#put-ltkeygt-ltvaluegt)
23+
- [DEL &lt;key&gt;](#del-ltkeygt)
24+
- [LS](#ls)
25+
- [START &lt;key-pattern&gt;](#start-ltkey-patterngt)
26+
- [END &lt;key-pattern&gt;](#end-ltkey-patterngt)
27+
- [LIMIT &lt;number&gt;](#limit-ltnumbergt)
28+
- [REVERSE](#reverse)
29+
- [CLI commands](#cli-commands)
30+
- [--get &lt;key&gt;](#--get-ltkeygt)
31+
- [--put &lt;key&gt;](#--put-ltkeygt)
32+
- [--del &lt;key&gt;](#--del-ltkeygt)
33+
- [--batch &lt;operations&gt;](#--batch-ltoperationsgt)
34+
- [--keys](#--keys)
35+
- [--values](#--values)
36+
- [--all](#--all)
37+
- [--start &lt;key-pattern&gt;](#--start-ltkey-patterngt)
38+
- [--end &lt;key-pattern&gt;](#--end-ltkey-patterngt)
39+
- [--match &lt;key-pattern&gt;](#--match-ltkey-patterngt)
40+
- [--limit &lt;number&gt;](#--limit-ltnumbergt)
41+
- [--reverse](#--reverse)
42+
- [--line](#--line)
43+
- [--length](#--length)
44+
- [--valueEncoding &lt;string&gt;](#--valueencoding-ltstringgt)
45+
- [--location &lt;string&gt;](#--location-ltstringgt)
46+
47+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
48+
49+
## Installation
1650

1751
```
1852
$ npm install -g lev
1953
```
2054

21-
# BASIC USAGE
55+
## REPL commands
2256

23-
```
57+
Start the REPL
58+
```sh
59+
# in the current directory
60+
$ lev
61+
# somewhere else
2462
$ lev path/to/db
2563
```
2664

27-
# REPL COMMANDS
2865
Use upper or lower case for the following commands.
2966

30-
## GET &lt;key&gt;
67+
### GET &lt;key&gt;
3168
Get a key from the database.
3269

33-
## PUT &lt;key&gt; &lt;value&gt;
70+
### PUT &lt;key&gt; &lt;value&gt;
3471
Put a value into the database. If you have `keyEncoding` or `valueEncoding`
3572
set to `json`, these values will be parsed from strings into `json`.
3673

37-
## DEL &lt;key&gt;
74+
### DEL &lt;key&gt;
3875
Delete a key from the database.
3976

40-
## LS
77+
### LS
4178
Get all the keys in the current range.
4279

43-
## START &lt;key-pattern&gt;
80+
### START &lt;key-pattern&gt;
4481
Defines the start of the current range. You can also use `GT` or `GTE`.
4582

46-
## END &lt;key-pattern&gt;
83+
### END &lt;key-pattern&gt;
4784
Defines the end of the current range. You can also use `LT` or `LTE`.
4885

49-
## LIMIT &lt;number&gt;
86+
### LIMIT &lt;number&gt;
5087
Limit the number of records in the current range (defaults to 5000).
5188

52-
## REVERSE
89+
### REVERSE
5390
Reverse the records in the current range.
5491

55-
# CLI COMMANDS
56-
These all match the parameters used with
57-
[`levelup`](https://github.com/rvagg/node-levelup). The default encoding
58-
for the database is set to `json`.
92+
## CLI commands
93+
These all match the parameters used with [`levelup`](https://github.com/rvagg/node-levelup). The default encoding for the database is set to `json`.
5994

60-
## --get &lt;key&gt;
95+
### --get &lt;key&gt;
6196
Get a value
6297
```sh
6398
lev --get foo
6499
```
65100

66-
## --put &lt;key&gt;
101+
### --put &lt;key&gt;
67102
Put a value
68103
```sh
69104
lev --put foo --value bar
70105
```
71106

72-
## --del &lt;key&gt;
107+
### --del &lt;key&gt;
73108
Delete a value
74109
```sh
75110
lev --del foo
76111
```
77112

78-
## --batch &lt;operations&gt;
113+
### --batch &lt;operations&gt;
79114
Put or delete several values, using [`levelup` batch syntax](https://github.com/Level/levelup#dbbatcharray-options-callback-array-form)
80115
```sh
81116
lev --batch '[
@@ -120,20 +155,20 @@ gzip -dk leveldb.export.gz
120155
lev /tmp/my-new-db --batch leveldb.export
121156
```
122157

123-
## --keys
158+
### --keys
124159
List all the keys in the current range. Will tabularize the output by default (see `--line`).
125160
```sh
126161
lev --keys
127162
```
128163

129-
## --values
164+
### --values
130165
List all the values in the current range.
131166
Emit as a new-line delimited stream of json.
132167
```sh
133168
lev --values
134169
```
135170

136-
## --all
171+
### --all
137172
List all the keys and values in the current range.
138173
Emit as a new-line delimited stream of json.
139174
```sh
@@ -145,7 +180,7 @@ lev --all > leveldb.export
145180
lev /tmp/my-new-db --batch leveldb.export
146181
```
147182

148-
## --start &lt;key-pattern&gt;
183+
### --start &lt;key-pattern&gt;
149184
Specify the start of the current range. You can also use `gt` or `gte`.
150185
```sh
151186
# output all keys after 'foo'
@@ -156,7 +191,7 @@ lev --keys --gte 'foo'
156191
lev --values --start 'foo'
157192
```
158193

159-
## --end &lt;key-pattern&gt;
194+
### --end &lt;key-pattern&gt;
160195
Specify the end of the current range. You can also use `lt` and `lte`.
161196
```sh
162197
# output all keys before 'fooz'
@@ -169,7 +204,7 @@ lev --values --end 'fooz'
169204
lev --keys --start 'foo' --end 'fooz'
170205
```
171206

172-
## --match &lt;key-pattern&gt;
207+
### --match &lt;key-pattern&gt;
173208
Filter keys or values by a pattern applied on the key
174209
```sh
175210
lev --keys --match 'f*'
@@ -181,28 +216,28 @@ lev --match 'f*'
181216

182217
See [`minimatch` doc](https://github.com/isaacs/minimatch#readme) for patterns
183218

184-
## --limit &lt;number&gt;
219+
### --limit &lt;number&gt;
185220
Limit the number of records emitted in the current range.
186221
```sh
187222
lev --keys --limit 10
188223
lev --values --start 'foo' --end 'fooz' --limit 100
189224
lev --match 'f*' --limit 10
190225
```
191226

192-
## --reverse
227+
### --reverse
193228
Reverse the stream.
194229
```sh
195230
lev --keys --reverse
196231
lev --keys --start 'foo' --end 'fooz' --limit 100 --reverse
197232
```
198233

199-
## --line
234+
### --line
200235
Output one key per line (instead of the default tabularized output)
201236
```sh
202237
lev --keys --line
203238
```
204239

205-
## --length
240+
### --length
206241
Output the length of the current range
207242
```sh
208243
# Count all the key/value pairs in the database
@@ -211,13 +246,13 @@ lev --length
211246
lev --start 'foo' --end 'fooz' --length
212247
```
213248

214-
## --valueEncoding &lt;string&gt;
249+
### --valueEncoding &lt;string&gt;
215250
Specify the encoding for the values (Defaults to 'json').
216251
```sh
217252
lev --values --valueEncoding buffer
218253
```
219254

220-
## --location &lt;string&gt;
255+
### --location &lt;string&gt;
221256
Specify the path to the LevelDB to use. Defaults to the current directory.
222257
```sh
223258
lev --location /tmp/test-db --keys

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"bin": "./bin/lev",
66
"description": "CLI & REPL for LevelDB",
77
"scripts": {
8-
"test": "echo \"Error: no test specified\" && exit 1"
8+
"test": "echo \"Error: no test specified\" && exit 1",
9+
"update-toc": "doctoc README.md"
910
},
1011
"repository": {
1112
"type": "git",
@@ -44,5 +45,8 @@
4445
"split": "^1.0.1",
4546
"tabulate": "^1.0.0",
4647
"xtend": "^4.0.0"
48+
},
49+
"devDependencies": {
50+
"doctoc": "^1.3.1"
4751
}
4852
}

0 commit comments

Comments
 (0)