UNPKG

@loaders.gl/core

Version:

Framework-independent loaders for 3D graphics formats

21 lines (18 loc) 676 B
import {isBrowser} from '../../utils/globals'; import assert from '../../utils/assert'; import * as node from '../../node/write-file.node'; import {resolvePath} from './file-aliases'; export function writeFile(filePath, arrayBufferOrString, options) { filePath = resolvePath(filePath); if (!isBrowser && node.writeFile) { return node.writeFile(filePath, arrayBufferOrString, options); } return assert(false); } export function writeFileSync(filePath, arrayBufferOrString, options) { filePath = resolvePath(filePath); if (!isBrowser && node.writeFileSync) { return node.writeFileSync(filePath, arrayBufferOrString, options); } return assert(false); }