Skip to content

jsonicjs/hoover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@jsonic/hoover

A Jsonic syntax plugin that adds configurable block-delimited string parsing. Define custom string formats with start/end delimiters, escape sequences, and context-sensitive matching.

Available for TypeScript and Go.

npm version build Coverage Status Known Vulnerabilities DeepScan grade Maintainability

Voxgig This open source module is sponsored and supported by Voxgig.

Tutorials

Learn by building working examples from scratch.

How-to guides

Solve specific problems with hoover configuration.

Explanation

Understand how hoover works under the hood.

Reference

Complete API documentation for each language.

Quick example

Parse triple-quoted strings that preserve internal whitespace and newlines:

TypeScript

const j = Jsonic.make().use(Hoover, {
  block: {
    triplequote: {
      start: { fixed: "'''" },
      end: { fixed: "'''" },
    }
  }
})

j("{a: '''hello world'''}") // { a: 'hello world' }

Go

j := jsonic.Make()
j.Use(hoover.Make(hoover.Options{
  Block: map[string]*hoover.Block{
    "triplequote": {
      Start: hoover.StartSpec{Fixed: []string{"'''"}},
      End:   hoover.EndSpec{Fixed: []string{"'''"}},
    },
  },
}))

j.Parse("{a: '''hello world'''}") // map[string]any{"a": "hello world"}

License

MIT. Copyright (c) Richard Rodger and other contributors.

About

A Jsonic plugin to hoover up strings.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors