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

@vercel/blob

Package Overview
Dependencies
Maintainers
217
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vercel/blob - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

dist/index.js

@@ -1,1 +0,1 @@

import{fetch as r}from"undici";async function c(e,o,t){if(!e)throw new Error("vercelBlob.put: pathname is required");if(!o)throw new Error("vercelBlob.put: body is required");if(!t||t.access!=="public")throw new Error('vercelBlob.put: access must be "public"');return(await r(`${n()}/${e}`,{method:"PUT",body:o,headers:{authorization:`Bearer ${s(t)}`},duplex:"half"})).json()}async function d(e,o){let t=new URL(n());t.searchParams.set("url",e),await r(t,{method:"DELETE",headers:{authorization:`Bearer ${s(o)}`}})}async function u(e,o){let t=new URL(n());t.searchParams.set("url",e);let i=await(await r(t,{method:"GET",headers:{authorization:`Bearer ${s(o)}`}})).json();return{...i,uploadedAt:new Date(i.uploadedAt)}}function n(){return process.env.BLOB_STORE_API_URL||"https://blob.vercel-storage.com"}function s(e){if(e!=null&&e.token)return e.token;if(!process.env.BLOB_STORE_WRITE_TOKEN)throw new Error("BLOB_STORE_WRITE_TOKEN environment variable is not set. Please set it to your write token.");return process.env.BLOB_STORE_WRITE_TOKEN}export{d as del,u as head,c as put};
import{fetch as r}from"undici";async function c(e,o,t){if(!e)throw new Error("vercelBlob.put: pathname is required");if(!o)throw new Error("vercelBlob.put: body is required");if(!t||t.access!=="public")throw new Error('vercelBlob.put: access must be "public"');return(await r(`${n()}/${e}`,{method:"PUT",body:o,headers:{authorization:`Bearer ${s(t)}`},duplex:"half"})).json()}async function d(e,o){let t=new URL(n());t.searchParams.set("url",e),await r(t,{method:"DELETE",headers:{authorization:`Bearer ${s(o)}`}})}async function u(e,o){let t=new URL(n());t.searchParams.set("url",e);let i=await(await r(t,{method:"GET",headers:{authorization:`Bearer ${s(o)}`}})).json();return{...i,uploadedAt:new Date(i.uploadedAt)}}function n(){return process.env.VERCEL_BLOB_API_URL||"https://blob.vercel-storage.com"}function s(e){if(e!=null&&e.token)return e.token;if(!process.env.BLOB_STORE_WRITE_TOKEN)throw new Error("BLOB_STORE_WRITE_TOKEN environment variable is not set. Please set it to your write token.");return process.env.BLOB_STORE_WRITE_TOKEN}export{d as del,u as head,c as put};
{
"name": "@vercel/blob",
"version": "0.2.2",
"version": "0.2.3",
"description": "The Vercel Blob JavaScript API client",

@@ -57,3 +57,3 @@ "homepage": "https://vercel.com/blob",

"@types/jest": "29.5.1",
"@types/node": "18.15.11",
"@types/node": "18.15.12",
"@vercel/style-guide": "4.0.2",

@@ -60,0 +60,0 @@ "axios": "1.3.6",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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