API made, how do i call the stored information

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lynn_Len

I was able to make an A.P.I that can store information contained in a JSON file but i don’t know how to call that information in a different node?

just to be safe heres the code for storing information

extends Node

var data = {}
var path = "res://Json_Files/test_file3.json"

export (String, FILE) var json_file = null

func _ready():

func _API():
	var jsonfile = File.new()
	jsonfile.open(path, File.READ)
	data = parse_json(jsonfile.get_as_text())
:bust_in_silhouette: Reply From: Oen44

Use Singletons. That way you can call that script from anywhere.