A response builder for JavaScript / TypeScript.
This package includes different response builders based on the JSON response structure specified in JSON Data Errors Response (JDER). With the builders, various kinds of responses can be created easily instead of sending plain text responses.
Install this package as a dependency in the project:
# npm
npm i @jderstd/core
# Yarn
yarn add @jderstd/core
# pnpm
pnpm add @jderstd/core
# Deno
deno add npm:@jderstd/core
# Bun
bun add @jderstd/core
To create a JSON response, use the following code:
import { createJsonResponse } from "@jderstd/core";
const route = (): Response => {
return createJsonResponse();
}
And the response will be shown as below:
{
"success": true
}
For the documentation, please refer to the Documentation.
For the package APIs, please refer to the APIs.
This project is licensed under the terms of the MIT license.