UNPKG

react-native-drawing

Version:

A React Native library that provides a canvas to perform drawing actions

14 lines (12 loc) 332 B
import { readFile } from 'node:fs/promises' const ENCODE = 'utf-8' /** * @param { string } filePath * @returns { Promise<string|null> } */ export async function loadContent( filePath ) { /** @type { string | null } */ let result try { result = await readFile( filePath, ENCODE ) } catch { result = null } return result }