fejkdata
Locale-aware fake data for tests, fixtures and seed data, from JSON templates. fejkdata is both a CLI and a Go library, with the data built in and no dependencies.
Hello, world
A template is text with {…} tokens that each draw a value from fejkdata's data. This one draws a person from the en_US data:
{/en_US.person}
Pipe it into the CLI, here in sh, bash or zsh:
echo '{/en_US.person}' | fejkdata --seed 1
With fejkdata v0.8.0, that prints:
Elliot Young
Install
- CLI on macOS or Linux, with Homebrew
brew install larvit/tap/fejkdata- CLI on Windows, with Scoop
scoop bucket add larvit https://github.com/larvit/scoop-bucket && scoop install fejkdata- CLI on any OS with Docker
It renders the template indocker run --rm -i larvit/fejkdata < template.jsontemplate.json. On shared CI runners, pullghcr.io/larvit/fejkdatainstead: Docker Hub limits anonymous pulls per IP address.- CLI on any OS with Go
go install github.com/larvit/fejkdata/cmd/fejkdata@latest- Go library, in a Go project
go get github.com/larvit/fejkdata
Debian, Ubuntu, Fedora, RHEL, Alpine and release binaries
- Debian, Ubuntu
sudo curl -fsSLo /etc/apt/keyrings/fejkdata.asc https://larvit.github.io/fejkdata/fejkdata.asc echo 'deb [signed-by=/etc/apt/keyrings/fejkdata.asc] https://larvit.github.io/fejkdata/deb stable main' | sudo tee /etc/apt/sources.list.d/fejkdata.list sudo apt update && sudo apt install fejkdata- Fedora, RHEL
sudo curl -fsSLo /etc/yum.repos.d/fejkdata.repo https://larvit.github.io/fejkdata/rpm/fejkdata.repo sudo dnf install fejkdata- Alpine, as root
wget -qO /etc/apk/keys/fejkdata.rsa.pub https://larvit.github.io/fejkdata/apk/fejkdata.rsa.pub echo https://larvit.github.io/fejkdata/apk >> /etc/apk/repositories apk add fejkdata
Each release also carries the binaries for Linux, macOS and Windows on amd64 and arm64, and the .deb, .rpm and .apk packages. The binaries are unsigned: macOS refuses to run one a browser downloaded until you run xattr -d com.apple.quarantine fejkdata.
Try it
This runs fejkdata in your browser, with all its data. Nothing is sent anywhere.
Downloading fejkdata and its data…