This module adds a subset of the fetch API for Node.js. This allows code written for the browser to also execute in
The main goal of this module is to provide enough compatibility to allow running unit tests in
Node.js. It is not 100% feature and behavior compatible with
The feature set is that of node-fetch with the addition of a dummy
Import the module for its side-effects:
fetch to the global
Behavior in a Browser Context
When this module is used in a browser context, it does not perform any actions, nor adds any code.
Generate a Bundle
If you want to have a compiled project, you can use bundle commands. After running each of the following commands in the
To have the bundled files with source map, run:
npm run bundle
To get a minified version for production, run:
npm run bundle:prod
npm run prepublish-bundle
Use a Bundle from CDN
html and create an object of userAuth:
<!DOCTYPE html> <html lang="en"> <head> <script src="https://unpkg.com/@here/olp-sdk-fetch/bundle.umd.min.js"></script> </head> <body></body> </html>
Copyright (C) 2019-2021 HERE Europe B.V.
For license details, see the LICENSE.