yes-as-a-service-api-client
v1.0.1
Published
A minimal JavaScript/TypeScript client for the Yes As A Service API — an API that always responds with a positive affirmation.
Maintainers
Readme
Yes As A Service API Client
A tiny JavaScript/TypeScript client for the Yes As A Service API — fetch random positive affirmations with a single request.
📦 Installation
npm install yes-as-a-service-api-client📜 Design Philosophy
- Zero configuration
- No inputs required
- Minimal surface area
- Predictable API responses
- Native fetch support
- TypeScript-first
🔤 Example Usage
import { getAYes } from "yes-as-a-service-api-client";
async function run() {
const response = await getAYes();
if (response.code === "api-ok") {
console.log(response.payload?.affirmation);
} else {
console.error(response.message);
}
}
run();
// Sample Success Response
/*
{
"code": "api-ok",
"message": "No errors encountered, check payload",
"payload": {
"affirmation": "Yes! Everything is working exactly as intended."
}
}
*/
// Sample Error Response
/*{
"code": "api-fail",
"message": "Something went wrong",
"payload": null
}*/📘 Contributing
Contributions, suggestions, and improvements are welcome. Feel free to open issues or pull requests.
❤️ Support
Like this project? Support it with a github star, it would mean a lot to me! Cheers and Happy Coding.
