A Node.js wrapper for Sanity´s Go implementation.
import { format } from 'groqfmt-nodejs'
const query = `
*[_type == 'page'] {
mainSection {
pageTitle,
gallery[] {}
`
try {
const queryFormatted = await format(query);
// ...
} catch(e) {
// ...
}