{"size": 599, "ext": "js", "max_stars_repo_path": "pkg-tests/node-load.js", "max_stars_repo_name": "IIIF-Commons/vault", "max_stars_repo_stars_event_min_datetime": "2022-01-18T15:49:28.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-23T14:43:48.000Z", "max_issues_repo_path": "pkg-tests/node-load.js", "max_issues_repo_name": "IIIF-Commons/vault", "max_issues_repo_issues_event_min_datetime": "2022-01-17T01:27:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-21T14:55:35.000Z", "max_forks_repo_path": "pkg-tests/node-load.js", "max_forks_repo_name": "IIIF-Commons/vault", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 23.96, "max_line_length": 78, "alphanum_fraction": 0.6010016694}
const { globalVault, Vault } = require('@iiif/vault');

(async () => {
  const fetch = await import('node-fetch');

  const vault1 = globalVault();
  const vault2 = new Vault({
    customFetcher: (url) => {
      return fetch(url).then((r) => r.json());
    },
  });

  try {
    await vault1.loadManifest('https://digirati-co-uk.github.io/wunder.json');
  } catch (e) {
    console.log('error loading from globalVault()', e);
  }

  try {
    await vault2.loadManifest('https://digirati-co-uk.github.io/wunder.json');
  } catch (e) {
    console.log('error loading from new Vault()', e);
  }
})();
