New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jsenv/fetch

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/fetch

Unified url fetcher (http, http, file, data)

  • 1.1.81
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
273
increased by123.77%
Maintainers
2
Weekly downloads
 
Created
Source

fetchUrl

fetchUrl is an async function requesting an url and returning a response object. It is a small wrapper on top of node-fetch. It was created to provide a unified approach to request file and data urls.

import { fetchUrl } from "@jsenv/fetch";

const responseForFile = await fetchUrl("file:///Users/you/index.html", {
  method: "GET",
  headers: {
    "if-modified-since": "Wed, 21 Oct 2015 07:28:00 GMT",
  },
});

const responseForHttp = await fetchUrl("http://example.com/file.js", {
  method: "GET",
  headers: {
    "if-modified-since": "Wed, 21 Oct 2015 07:28:00 GMT",
  },
});

FAQs

Package last updated on 28 Jan 2025

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