MaterialXLab API  0.0.1
APIs For MaterialXLab Libraries
Loading...
Searching...
No Matches
iana.js
Go to the documentation of this file.
1async function fetchIanaUriSchemes() {
2 const url = "https://www.iana.org/assignments/uri-schemes/uri-schemes-1.csv";
3 try {
4 const response = await fetch(url);
5 const text = await response.text();
6 const lines = text.split("\n");
7 // Skip the header and extract the scheme names
8 const schemes = lines.slice(1).map(line => line.split(",")[0].replace(/"/g, '').trim());
9 return schemes;
10 } catch (error) {
11 console.error("Failed to fetch URI schemes:", error);
12 return [];
13 }
14}
15
16// Example usage
17fetchIanaUriSchemes().then(schemes => {
18 console.log("Fetched URI schemes:", schemes);
19});
function async fetchIanaUriSchemes()
Definition iana.js:1