Search... Ctrl + K

Pretty Print JSON (helper)
One script reply has been approved by the moderators Verified

Created by rubenmestwet 178 days ago Used 25 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
export async function main(value: object|string, indentation = 2) {
    if (typeof value === 'string') {
        value = JSON.parse(value);
    }
    return JSON.stringify(value, null, indentation);
}

Submitted by jaller94 112 days ago

Edited 112 days ago

No comments yet