Convenient way to create a JSON file containing all directory entries:

$ find * -maxdepth 0 -exec echo "- {}" \; | js-yaml > index.json

$ cat index.json
[
"assets",
"index.html",
"index.json",
"package.json"
]

(github.com/nodeca/js-yaml )

Follow

This probably fails for some special characters. I just hope I will never see that happen. 🤷

Sign in to participate in the conversation
Octodon

Octodon is a nice general purpose instance. more