Created
July 4, 2025 16:04
-
-
Save cowchimp/8f70643054b629e6bdfde60aa9ba2434 to your computer and use it in GitHub Desktop.
n8n code node that turns the input json data to a JSONL binary file (single line json object with new line at the end)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const content = $input.item.json.content; | |
const jsonlString = JSON.stringify(content) + '\n'; | |
const buffer = Buffer.from(jsonlString, 'utf-8'); | |
const binaryData = await this.helpers.prepareBinaryData( | |
buffer, | |
'data.jsonl', | |
'application/jsonl' | |
); | |
return { | |
binary: { | |
data: binaryData, | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment