tiny-ok-message
v0.4.0
Published
A tiny TypeScript helper for fetching an OK response message from DummyJSON.
Maintainers
Readme
tiny-ok-message
An intentionally small, fetch-based package that is useful for quick API-client experiments.
📦 Installation
npm install tiny-ok-message📘 Features
- One small exported helper:
getOkMessage - Accepts a typed input object shaped as
{ message: string } - Calls the DummyJSON HTTP 200 endpoint with a URL-encoded message
- Returns a typed response shaped as
{ status: string; message: string } - TypeScript ready with generated declaration files
- ESM package output through
dist - Unit tested with Jest and
ts-jest
🔤 Example Usage
/* node modules */
import { getOkMessage } from 'tiny-ok-message';
/* example */
async function run() {
const response = await getOkMessage({ message: 'hello world' });
console.log(response);
}
await run();Expected response shape:
{ status: "200", message: "hello world" }📗 Test Coverage
PASS src/messages/test/get-ok-message.test.ts
getOkMessage
✓ fetches the OK message from DummyJSON
✓ throws when the request fails-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
get-ok-message.ts | 100 | 100 | 100 | 100 |
-------------------|---------|----------|---------|---------|-------------------🔒 Security & Privacy
- This package is open source and designed as a tiny API helper for the public DummyJSON HTTP endpoint. It does not collect, store, sell, rent, trade, monetize, or process personal data for its own purposes.
- The package only makes HTTP requests as part of its documented behavior. Any data handled by the package is limited to the
messagevalue explicitly provided by the consuming application. - This package does not include analytics, tracking, telemetry, advertising, hidden background services, install scripts, or project-owned data collection systems.
❤️ Support
Like this project? Support it with a GitHub star. Cheers and happy coding.
