Gathering detailed insights and metrics for rpc-bluebird
Gathering detailed insights and metrics for rpc-bluebird
npm install rpc-bluebird
Typescript
Module System
Min. Node Version
Node Version
NPM Version
67.2
Supply Chain
99.3
Quality
75.9
Maintenance
100
Vulnerability
100
License
TypeScript (98.78%)
Shell (1.22%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
6,481
Last Day
1
Last Week
8
Last Month
53
Last Year
343
252 Commits
1 Forks
2 Watching
3 Branches
3 Contributors
Latest Version
5.0.1
Package Id
rpc-bluebird@5.0.1
Unpacked Size
17.38 kB
Size
5.58 kB
File Count
10
NPM Version
8.13.1
Node Version
16.15.1
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-66.7%
8
Compared to previous week
Last month
71%
53
Compared to previous month
Last year
-14.7%
343
Compared to previous year
rpc-bluebird
is a simple wrapper of the node-fetch
library in a class. Note, that the Blubird
promise library is used instead of native promises.
1npm install rpc-bluebird
rpc-bluebird
accepts the following parameters
1const fetchClientOptions = { 2 baseUrl: "http://worldtimeapi.org/", // used to resolve the url - `new URL(path, baseUrl)` 3 rejectNotOk: false, // default - `true`, reject a promise on non 2xx responses 4 transform: "text", // default - `'raw'` 5};
as fetchClientOptions
. Please refer to the node-fetch
documentation for the full list of all supported options you can pass as fetchOptions
.
1import { FetchClient } from "rpc-bluebird"; 2const fetchOptions = { headers: { "User-Agent": "MyClass-User-Agent" } }; 3const fetchClientOptions = { baseUrl: "http://worldtimeapi.org/" }; 4const path = "/api/ip"; 5class MyClass extends FetchClient { 6 constructor() { 7 super(fetchOptions, fetchClientOptions); 8 } 9} 10const myClass = new MyClass(); 11const bluebirdPromise = myClass.fetch(path); 12bluebirdPromise 13 .then((response) => { 14 console.info(bluebirdPromise.isResolved()); 15 response.json().then(console.log).catch(console.error); 16 }) 17 .catch(console.error); 18console.info(bluebirdPromise.isPending());
fetch
1import FetchClient from "rpc-bluebird"; 2const client = new FetchClient<unknown>({}, { transform: "json" }); 3client 4 .fetch("http://worldtimeapi.org/api/ip") 5 .then(console.log) 6 .catch(console.error);
get
1const client = new FetchClient<Buffer>({}, { transform: "buffer" }); 2client 3 .get("http://worldtimeapi.org/api/ip") 4 .then((data) => { 5 console.log(data instanceof Buffer); 6 }) 7 .catch(console.error);
post
1const client = new FetchClient<Buffer>( 2 { body: JSON.stringify({ data: "Hello World!" }) }, 3 { transform: "buffer" } 4); 5client 6 .post("https://httpbin.org/anything") 7 .then((data) => { 8 console.log(data instanceof Buffer); 9 }) 10 .catch(console.error);
put
1const client = new FetchClient<ArrayBuffer>( 2 { body: JSON.stringify({ data: "Hello World!" }) }, 3 { transform: "arrayBuffer" } 4); 5client 6 .put("https://httpbin.org/anything") 7 .then((data) => { 8 console.log(data instanceof ArrayBuffer); 9 }) 10 .catch(console.error);
patch
1import Blob from "fetch-blob"; 2const client = new FetchClient<Blob>( 3 { body: JSON.stringify({ data: "Hello World!" }) }, 4 { transform: "blob", rejectNotOk: true } 5); 6client 7 .patch("https://httpbin.org/anything") 8 .then((data) => { 9 console.log(data instanceof Blob); 10 }) 11 .catch(console.error);
delete
1const baseUrl = "https://httpbin.org/"; 2const client = new FetchClient<string>({ transform: "text", baseUrl }); 3client 4 .delete("/anything") 5 .then((data) => { 6 console.log(typeof data === "string"); 7 }) 8 .catch(console.error);
head
1import { UnsuccessfulFetch, FetchClient } from "rpc-bluebird"; 2const baseUrl = "http://worldtimeapi.org/"; 3const client = new FetchClient<unknown>({}, { transform: "json", baseUrl }); 4client 5 .head("/badurl") 6 .then(console.log) 7 .catch((error) => { 8 if (error instanceof UnsuccessfulFetch) { 9 console.log(error.response.status); // 404 10 } else { 11 console.error(error); 12 } 13 });
options
1const baseUrl = "https://httpbin.org/"; 2const client = new FetchClient<unknown>({}, { transform: "json", baseUrl }); 3client.options("/anything").then(console.log).catch(console.error);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
security policy file not detected
Details
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
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
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