Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
sbinet.org/x/odt
odt
is a set of Go-based tools to deal with the ODT file format.
$> go install sbinet.org/x/odt
func main() {
doc, err := odt.Open("testdata/simple.odt")
if err != nil {
panic(err)
}
defer doc.Close()
var depth int
indent := func() string {
return strings.Repeat(" ", depth)
}
err = odt.Walk(doc.Node(), func(n odt.Node, entering bool) (odt.WalkStatus, error) {
switch {
case entering:
ii := indent()
fmt.Printf("%s<%s> {\n", ii, n.Name())
depth++
default:
switch n := n.(type) {
case *odt.Text:
if n.Value != "" {
fmt.Printf("%stext: %q\n", indent(), n.Value)
}
}
depth--
ii := indent()
fmt.Printf("%s}\n", ii)
}
return odt.WalkContinue, nil
})
if err != nil {
panic(err)
}
}
odt2md
tries its best at converting an ODT document to a CommonMark one:
$> go install sbinet.org/x/odt/cmd/odt2md@latest
$> odt2md -h
odt2md converts an ODT document into a CommonMark one.
Usage: odt2md [OPTIONS] [INPUT.odt]
Example:
$> odt2md input.odt
$> odt2md input.odt > out.md
$> odt2md -o out.md input.odt
$> odt2md < input.odt > out.md
$> odt2md -o out.md < input.odt
Options:
-o string
path to output CommonMark file
$> odt2md ./testdata/simple.odt
# Title
Hello World!
FAQs
Unknown package
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.