go-dejsonlz4

command module
v0.0.0-...-537ffa8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

go-dejsonlz4

Decompress Firefox bookmark files with .jsonlz4 extension, a plain lz4 format but with custom header (so-called mozLz4).

Usage

Run it from the terminal:

# build from source 
:~$ go build -o go-dejsonlz4
# or, install from the GitHub repo
:~$ go install github.com/giulianopz/go-dejsonlz4@latest
:~$ go-dejsonlz4 -h
Usage: go-dejsonlz4 [-h] IN_FILE [OUT_FILE]
Example: go-dejsonlz4 ~/.mozilla/firefox/$PROFILE_NAME/bookmarkbackups/$FILE_NAME.jsonlz4
Decompress Firefox bookmark files with .jsonlz4 extension from IN_FILE to OUT_FILE:
        * -h, display help message and exit,
        * IN_FILE='-', uncompress from standard input,
        * OUT_FILE='-' or missing, uncompress to standard output.

Or use it in your go module:

package main

import (
	"fmt"
	"os"

	dejsonlz4 "github.com/giulianopz/go-dejsonlz4"
)

func main() {

	inputData, err := os.ReadFile(os.Args[1])
	if err != nil {
		panic(err)
	}

	outputData, err := dejsonlz4.Uncompress(inputData)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(outputData))
}

References

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL