Gathering detailed insights and metrics for popsicle
Gathering detailed insights and metrics for popsicle
Gathering detailed insights and metrics for popsicle
Gathering detailed insights and metrics for popsicle
npm install popsicle
Fix missing dependency
Published on 21 Nov 2023
Update `popsicle-transport-http` and `popsicle-cookie-jar` min versions
Published on 21 Nov 2023
XHR ArrayBuffer
Published on 07 Oct 2020
Update Servie and HTTP transport
Published on 11 Sept 2020
Updated Dependencies
Published on 03 Nov 2019
Export `toFetch`
Published on 05 Jul 2019
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
246 Stars
369 Commits
19 Forks
8 Watching
33 Branches
10 Contributors
Updated on 30 May 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-7.2%
38,003
Compared to previous day
Last week
3.7%
219,100
Compared to previous week
Last month
13.1%
880,259
Compared to previous month
Last year
-6.1%
10,595,626
Compared to previous year
Advanced HTTP requests in node.js and browsers, using Servie.
npm install popsicle --save
1import { fetch } from "popsicle"; 2 3const res = await fetch("http://example.com"); 4const data = await res.text();
Popsicle is a universal package, meaning node.js and browsers are supported without any configuration. This means the primary endpoint requires some
dom
types in TypeScript. When in a node.js or browser only environments prefer importingpopsicle/dist/{node,browser}
instead.
Popsicle re-exports Request
, Response
, Headers
and AbortController
from servie
. The fetch
function accepts the same arguments as Request
and returns a promise that resolves to Response
. You can use the Signal
event emitter (from AbortController#signal
) to listen to request life cycle events.
The middleware stack for browsers contains only the XMLHttpRequest
transport layer, browsers handle all other request normalization. This means a smaller and faster package for browsers.
The middleware stack for node.js includes normalization to act similar to browsers:
User-Agent
(Learn more)gzip
, deflate
and brotli
(Learn more)Important: If you are doing anything non-trivial with Popsicle, please override the
User-Agent
and respectrobots.txt
.
1import { fetch, AbortController } from "popsicle"; 2 3const controller = new AbortController(); 4 5setTimeout(() => controller.abort(), 500); 6 7const res = fetch("http://example.com", { 8 signal: controller.signal, 9});
Transports can return an error. The built-in codes are documented below:
Build the functionality you require by composing middleware functions and using toFetch
. See src/node.ts
for an example.
See Throwback for more information:
1type Plugin = ( 2 req: Request, 3 next: () => Promise<Response>, 4) => Promise<Response>;
This project is written using TypeScript and publishes the types to NPM alongside the package.
$http
serviceMIT
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More