2.0.0 • Published 3 years ago
oceanfacts.js v2.0.0
oceanfacts.js
oceanfacts.js is a wrapper for the OceanFacts API.
const oceanfacts = require("oceanfacts.js");
(async () => {
await oceanfacts.random();
/*
{
"_id": "0c3bb6d3-abd0-4579-b2e9-487983ced105",
"value": "The lion's mane jellyfish is the largest jellyfish species; it can grow to be 8 feet wide and 120 feet long.",
"categories": [
"biology"
],
"factPath": "/fact/0c3bb6d3-abd0-4579-b2e9-487983ced105/",
"success": true,
"createdAt": "2022-01-22T16:30:28.677Z",
"updatedAt": "2022-01-22T16:30:28.677Z"
}
*/
})();
Installation
$ npm install oceanfacts.js
Documentation
Error Handling
All errors return the following object:
{
success: false,
value: "..."
}
Methods
License
OceanFacts is licensed under the MIT License