Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Improve compatibility with NodeJS #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mikehhhhhhh
Copy link

@mikehhhhhhh mikehhhhhhh commented Jan 25, 2019

There are several common reasons why window might not be undefined in a NodeJS environment.

The detection is based on the solution used by detect-node, which should be a far more reliable test.

Also downloadFile and downloadLivePhoto fail when called from Node JS because File is not defined. This PR defaults the returnType to [] for these if File is undefined so it can return a Buffer in NodeJS.

@mikehhhhhhh mikehhhhhhh changed the title Use more reliable test for NodeJS in isFileParam Improve compatibility with NodeJS Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant