I have a unique situation where I am dealing with numerous files that have an unusual file extension.
My goal is to utilize JavaScript to read these files and then convert their contents into either JSON or regular JavaScript objects. Is this task even feasible?
I am somewhat optimistic because the file structure closely resembles JSON:
// file.unusualFileType
Page: {
id: P001
Title: "Page Title"
URL: "/home"
Elements: {
Button: {
Text: "Click me"
Action: SAVE
}
}
}
EDIT: Thanks to Håken Lid, my specific issue has been resolved. However, I still have a lingering curiosity about how one could go about reading any file as a string using JavaScript and potentially parsing such content.