Skip to content

Instantly share code, notes, and snippets.

@technovangelist
Created January 25, 2026 01:46
Show Gist options
  • Select an option

  • Save technovangelist/6cda665f516b97a01db3146910066538 to your computer and use it in GitHub Desktop.

Select an option

Save technovangelist/6cda665f516b97a01db3146910066538 to your computer and use it in GitHub Desktop.
git diff for n8n files
#!/usr/bin/env node
const fs = require('fs');
const path = process.argv[2];
let content = fs.readFileSync(path, 'utf8');
// Remove createdAt/updatedAt timestamps
content = content.replace(/\"createdAt\":\\s*\"[^\"]*\"/g, '\"createdAt\": \"REMOVED\"');
content = content.replace(/\"updatedAt\":\\s*\"[^\"]*\"/g, '\"updatedAt\": \"REMOVED\"');
// Remove position values
content = content.replace(/\"position\":\\s*\\[\\s*-?\\d+\\s*,\\s*-?\\d+\\s*\\]/g, '\"position\": [0,0]');
// Standardize version IDs
content = content.replace(/\"versionId\":\\s*\"[^\"]*\"/g, '\"versionId\": \"REMOVED\"');
// Remove staticData block
content = content.replace(/,\\s*\"staticData\"\\s*:\\s*{[^}]*}/g, '');
process.stdout.write(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment