MCPcopy Create free account
hub / github.com/processing/p5.js / fileExists

Function fileExists

src/webgl/loading.js:11–18  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

9import { request } from '../io/files';
10
11async function fileExists(url) {
12 try {
13 const response = await fetch(url, { method: 'HEAD' });
14 return response.ok;
15 } catch (error) {
16 return false;
17 }
18}
19
20function loading(p5, fn){
21 /**

Callers 1

getMaterialsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected