Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fetch-headers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-headers

fetch Headers polyfill

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-74.22%
Maintainers
1
Weekly downloads
 
Created
Source

Fetch headers polyfill

https://developer.mozilla.org/en-US/docs/Web/API/Headers

Packed with latest and newest method from the spec: iterator, entries, keys, values, and support of for...of

const Headers = require('fetch-headers')

header = new Headers([
  ['accept', 'application/json']
  ['accept', 'text/plain']
])

Notes

This use

  • WeakMap for private properties
  • Symbol.iterator and Generators* for iteration
  • vanilla ecmascript 6
  • no transpiler
  • no coffeescript or typescript

Up to date node version can just use this as is. (tested in v6.5.0)
Browsers should run this through closer-compiler, babel, Babili, browserify, webpack or equivalent.
Browsers need to include a polyfill for WeakMap if necessary.

Optional for those who want es5 version and don't have the time or effort to compile can use the prebuilt version

var Headers = require('fetch-headers/headers-es5.min.js')

Keywords

FAQs

Package last updated on 27 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc