Package Exports
- safedonate
- safedonate/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (safedonate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SafeDonate API (unofficial)
An (unofficial) API for SafeDonate, with full types support
Important notice
This API is unofficial, meaning I am not responisble for any damage caused by using this API. This API may be blocked at any time by SafeDonate's team. This API is never stable as SafeDonate can change at any time their website structure that will break this API.
Install
npm install safedonate
# or
yarn add safedonateUsage
import { fetchDonations } from "safedonate";
fetchDonations().then((donations) => {
console.log(donations[0]);
});
//=> JSON object containing donation info(also compitable with commonjs)
API
fetchDonations()
Example
const { fetchDonations } = require("safedonate");
fetchDonations().then((donations) => {
console.log(donations[0]);
});Will return something like this:
{
"URL (public)": "",
"Title (public)": "",
"Description (public)": "",
"Verification Result (public)": "",
"Original Message (public)": "",
"Is International? (public)": "",
"title_english": "",
"title_spanish": "",
"title_french": "",
"title_german": ""
}Which can be easily accessed by doing (thanks to the types available in the package):
const { fetchDonations } = require("../build/index");
fetchDonations().then((donations) => {
console.log(donations[0]["URL (public)"]);
});