https://github.com/sio/coolname
Random name and slug generator
https://github.com/sio/coolname
golang random-generation slug
Last synced: 17 days ago
JSON representation
Random name and slug generator
- Host: GitHub
- URL: https://github.com/sio/coolname
- Owner: sio
- License: apache-2.0
- Created: 2023-01-10T13:52:34.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T13:04:12.000Z (about 2 years ago)
- Last Synced: 2025-02-11T20:49:48.603Z (2 months ago)
- Topics: golang, random-generation, slug
- Language: Go
- Homepage:
- Size: 75.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Random name and slug generator
coolname is a Golang port of a [Python package][upstream] by [Alexander Lukanin].
All hard work of creating and maintaing word lists happens upstream.[upstream]: https://github.com/alexanderlukanin13/coolname
[Alexander Lukanin]: https://github.com/alexanderlukanin13## Documentation
See [package docs at pkg.go.dev][docs]
[docs]: https://pkg.go.dev/github.com/sio/coolname
## Installation
```console
$ go get github.com/sio/coolname
```## Usage
### Importing the package
```go
import "github.com/sio/coolname"
```### Generating cool names
```
>>> coolname.Slug()
"vegan-outrageous-bumblebee-of-discourse"
nil>>> coolname.SlugN(2)
"crimson-caracal"
nil>>> coolname.Generate()
[]string{
"kind",
"romantic",
"markhor",
"of",
"luxury",
}
nil
```### Advanced configuration
Several tunable knobs are provided, check the [docs] and source code to be able to:
- Provide custom word lists
- Create new lists by combining existing ones via plain concatenation or via
cartesian product (see [config.json], custom JSON inputs are supported!)
- Use custom random number generator[config.json]: data/config.json
## License and copyright
### Golang port (this package)
Copyright 2023 Vitaly Potyarkin, `Apache-2.0 License`
### Word lists and JSON config
Copyright 2015-2023 [Alexander Lukanin][upstream] and contributors, `BSD-2-Clause License`