Skip to content

A set of golang utils to work with newline delimited json (ndjson)

License

Notifications You must be signed in to change notification settings

kandros/go-ndjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ndjson

A set of golang utils to work with newline delimited json (ndjson)

installation

go get github.com/kandros/go-ndjson

usage

Reading from a file

package main

import (
	"os"

	ndjson "github.com/kandros/go-ndjson"
)

func main() {
	f, err := os.Open("db/logstore.log")
	if err != nil {
		panic(err)
	}

	s :=ndjson.ToJSON(f)
    // or as raw buffer b := ndjson.ToJSONToJSONbuffer(f)
    fmt.Print(s)
}

About

A set of golang utils to work with newline delimited json (ndjson)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages