@here/olp-sdk-fetch
Adds a subset of the fetch API for Node.js
Last updated 3 months ago by here-maps .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @here/olp-sdk-fetch 
SYNC missed versions from official npm registry.

Fetch Library

Overview

This module adds a subset of the fetch API for Node.js. This allows code written for the browser to also execute in Node.js.

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 fetch.

The feature set is that of node-fetch with the addition of a dummy AbortController.

Usage

Import the module for its side-effects:

import "@here/olp-sdk-fetch"

This adds fetch to the global Node.js namespace.

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 @here/olp-sdk-fetch folder from the root folder, you get the JavaScript bundled files.

To have the bundled files with source map, run:

npm run bundle

To get a minified version for production, run:

npm run bundle:prod

To get a bundled and minified JavaScript files, run:

npm run prepublish-bundle

Use a Bundle from CDN

Add minified JavaScript file to your 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>

LICENSE

Copyright (C) 2019 HERE Europe B.V.

For license details, see the LICENSE.

Current Tags

  • 1.4.0                                ...           latest (3 months ago)

8 Versions

  • 1.4.0                                ...           3 months ago
  • 1.3.0                                ...           5 months ago
  • 1.2.1                                ...           6 months ago
  • 1.2.0                                ...           6 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
  • 0.9.1                                ...           10 months ago
  • 0.9.0                                ...           10 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (24)

Copyright 2014 - 2017 © taobao.org |