1 2 3 4 5 6 7
#!/bin/sh set -eu cat "$1" printf '%s\n\n\nexport {\n' awk '/^const / { printf "\t%s,\n", $2 }' "$1" printf '}\n'