How to use the unfetch/package.json.version function in unfetch

To help you get started, we’ve selected a few unfetch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github edm00se / parcel-plugin-goodie-bag / index.js View on Github external
const fs = require('fs');
const path = require('path');
const URL = require('url');
const cheerio = require('cheerio');

const vendorLibVesrions = {
  'es6-promise': require('es6-promise/package.json').version,
  unfetch: require('unfetch/package.json').version
};

const goodieBagFileName = 'goodie-bag.min.js';
const goodieBagHeaderComment = `/**
* parcel-plugin-goodie-bag
* 
* Provides a high-level polyfill to both the Promise and fetch APIs, to keep parcel working on IE(11).
* This works around: https://github.com/parcel-bundler/parcel/issues/2364
* 
* Built with es6-promise@${vendorLibVesrions["es6-promise"]} and unfetch@${vendorLibVesrions.unfetch}.
*  
* src: https://github.com/edm00se/parcel-plugin-goodie-bag
*/`;

module.exports = function(bundler) {
  bundler.on('bundled', bund => {

unfetch

Bare minimum fetch polyfill in 500 bytes

MIT
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis