@esri/arcgis-rest-fetch
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@esri/arcgis-rest-request

This package exists to expose the node-fetch package in a consistent way for both Node JS 12.16+ and various bundlers with consistent TypeScript types based on the browser types.

This exposes a getFetch() method that returns a Promise that resolves with fetch, Headers, Request and Response. This is async because it uses import("node-fetch") under to hood to load node-fetch@3.0.0 which is ESM only. The only way to load an ESM module in CommonJS in Node is to use the async import().

The package.json contains fields for the following:

  • main - undefined, Node JS should use the exports field and conditional exports.
  • module - Exposes a ESM module. Used by Rollup and Parcel v2.
  • browser - Exposes a CJS module. Used by Parcel v1 and Browserify.
  • exports - exposes conditional exports config with the following conditions. Used by Webpack and soon to be others:
    • module - ESM module exposing browser globals.
    • browser - CJS module exposing browser globals.
    • import - ESM module exposing node-fetch.
    • require - CJS module exposing node-fetch.
    • default - ESM module exposing browser globals.

Copyright © 2017-2022 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.

Readme

Keywords

none

Package Sidebar

Install

npm i @esri/arcgis-rest-fetch

Weekly Downloads

6,511

Version

4.0.0

License

none

Unpacked Size

4.01 kB

Total Files

8

Last publish

Collaborators

  • benelan
  • joerodriguez-136
  • kit12303
  • jordantsanz
  • allieraney
  • robert.vo
  • noahmulfinger
  • ssylvia
  • paulcpederson
  • jgravois
  • patrickarlt
  • nixta
  • odoe
  • jwasilgeo
  • tomwayson
  • benstoltz
  • dbouwman
  • thollingshead
  • hhkaos
  • dpaddock
  • esri_dev
  • driskull
  • katelynseitz
  • jpurusho
  • rlibed
  • mtschudi
  • ajturner
  • gavinr
  • kellyhutchins
  • mjuniper
  • john4818
  • pr3tori4n
  • gbrown-gis
  • haoliang
  • macandcheese
  • jcfranco
  • alan0002
  • richgwozdz
  • rweber.esri
  • vivzhang
  • juliannemarik
  • drspacemanphd