UNPKG

read-png

Version:

Universal PNG File Reader. Uses read-pixels in the Browser and pngjs in NodeJS

11 lines (9 loc) 294 B
const readInNodeJS = require("./read-png.node.js"); const readInBrowser = require("./read-png.browser.js"); module.exports = input => { if (typeof window !== 'undefined') { return readInBrowser(input); } else if (typeof Buffer !== 'undefined') { return readInNodeJS(input); } };