Slug is a simple, lightweight, and fast slug generator for Go.
go get github.com/9ssi7/slug
packslug main
import (
"fmt"
"github.com/9ssi7/slug"
)
func main() {
fmt.Println(slug.New("Hello World!"))
// Output: hello-world
// check if a string is a valid slug
res := slug.Is("hello-world") // true
}
Documentation is available at pkg.go.dev.
Contributions are always welcome!