def METHOD_NAME(self, context):
    node = bpy.data.node_groups[self.treename].nodes[self.nodename]
    def callback(data):
        return json.dumps(data, indent=2)
    geometry = node.get_geometry()
    if geometry:
        exported_data = _exchange.export_dict_str(obj=geometry, callback=callback)
        text_name = node.text_block
        self.write_data(text_name, exported_data)
        return {'FINISHED'}
    else:
        self.report({'INFO'}, "No geometry to export")
        return {'CANCELLED'}