vastgrid-cli 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +66 -2
- package/dist/app.html +32 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +86 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +30 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +191 -0
- package/dist/server.js.map +1 -0
- package/package.json +53 -4
- package/src/cli.ts +91 -0
- package/src/index.ts +2 -0
- package/src/server.ts +219 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vastgrid contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vastgrid-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Open huge CSV, TSV, Parquet, JSON Lines and Excel files in a grid in the browser with one command. DuckDB reads the
|
|
4
|
+
files on this computer, in Node.js, and the page reads blocks of rows from it as you scroll: sort, filter, search,
|
|
5
|
+
group, pivot, add formulas, edit cells, export, and save edited CSV and TSV files with every byte that was not
|
|
6
|
+
edited kept as it is. Nothing leaves the computer.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx vastgrid-cli sales.parquet
|
|
10
|
+
npx vastgrid-cli --save data/
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Installed with `npm install -g vastgrid-cli`, the command is `vastgrid`.
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Usage: vastgrid [options] [<file or folder>…]
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--save Let the page save edited cells into CSV and TSV files (⌘S or Ctrl+S).
|
|
20
|
+
--port <n> The port on 127.0.0.1; a free one by default.
|
|
21
|
+
--no-open Print the address without opening the browser.
|
|
22
|
+
-h, --help Show this help.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The command prints the address of the page and opens it in the browser. Ctrl+C stops the server and DuckDB, which
|
|
26
|
+
deletes its temporary files.
|
|
27
|
+
|
|
28
|
+
## Files
|
|
29
|
+
|
|
30
|
+
- A file named opens when its name says it is a table: `.csv`, `.tsv`, `.tab`, `.parquet`, `.pq`, `.jsonl`,
|
|
31
|
+
`.ndjson`, `.json`, `.xlsx`, `.xlsm`, and `.gz` (also `.zst` for CSV and TSV) of the text formats.
|
|
32
|
+
- A folder named gives its table files, two folders deep, without hidden ones, at most 1,000. With nothing named,
|
|
33
|
+
the current folder is used.
|
|
34
|
+
- No other file opens: DuckDB reads nothing outside the folders of the files and folders named, links followed.
|
|
35
|
+
|
|
36
|
+
## The page
|
|
37
|
+
|
|
38
|
+
The page shows the first file with the toolbar, the status bar and a check box for each row; a list above the grid
|
|
39
|
+
chooses another file, and the sheets of a workbook are buttons. The address keeps the file and the sheet, so that
|
|
40
|
+
the browser's back and forward move between them. The page follows the browser's language (English or Japanese).
|
|
41
|
+
|
|
42
|
+
Edited cells are kept by DuckDB until the command stops. With `--save`, ⌘S or Ctrl+S (or the toolbar's Save)
|
|
43
|
+
writes them into the CSV or TSV file they came from, rewriting only the edited fields; without it, the command never
|
|
44
|
+
changes a file. A file changed on disk is read again, or, when it has edited cells, kept until they are discarded,
|
|
45
|
+
and never saved over. Exports (CSV, TSV, Parquet, JSON, Excel) are downloaded by the browser.
|
|
46
|
+
|
|
47
|
+
## Safety
|
|
48
|
+
|
|
49
|
+
The server answers on 127.0.0.1 only, and to the browser that opened the address it printed: the address holds a
|
|
50
|
+
random token, which becomes an `HttpOnly`, `SameSite=Strict` cookie, and every other request is refused. Requests
|
|
51
|
+
whose `Host` is not `127.0.0.1` or `localhost` are refused too, and the page may reach only its server.
|
|
52
|
+
`VASTGRID_TOKEN` (16 or more letters, digits, `-` and `_`) fixes the token, for an address that stays the same. To
|
|
53
|
+
use it from another computer, forward the port: `ssh -L 5185:127.0.0.1:5185`, with `--port 5185`.
|
|
54
|
+
|
|
55
|
+
It needs Node.js 20 or later on a platform that DuckDB ships a binary for: Linux (x64, arm64; glibc and musl), macOS
|
|
56
|
+
(x64, arm64) or Windows (x64, arm64).
|
|
57
|
+
|
|
58
|
+
## Links
|
|
59
|
+
|
|
60
|
+
- [docs/cli.md](https://github.com/yhay81/vastgrid/blob/main/docs/cli.md): the command in full.
|
|
61
|
+
- [Where vastgrid opens files](https://vastgrid.yhay81.com/apps/overview/): the other places vastgrid opens
|
|
62
|
+
files (a React component, VS Code, an MCP App, a notebook).
|
|
63
|
+
- [vastgrid.yhay81.com](https://vastgrid.yhay81.com) and [GitHub](https://github.com/yhay81/vastgrid).
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|