@galatajs/core
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published


@galatajs/core

errors, results or more for galatajs framework and you.

What Is It?

It contains some core packages for the galatajs framework to work in certain standards. Although it was developed for the galatajs framework, you can use it if you want.

You don't have to use galatajs framework, @galatajs/core is a nodejs package.

🔗 access on npm

Installation

npm install @galatajs/core

or with yarn

yarn add @galatajs/core

Usage Results

import { SuccessDataResult } from "@galatajs/core";

export type Product = {
    id: number;
    name: string;
    price: number;
}

const product : Product = {
    id: 1,
    name: "Product 1",
    price: 10
}

const result = new SuccessDataResult<Product>("Product created successfully", product);
console.log(result);
/**
 success: true,
 message: "Product created successfully",
 data: { id: 1, name: "Product 1", price: 10 }
 * */

Usage Errors

import {BadRequestError} from "@galatajs/core";

const error = new BadRequestError("Product name is required");
console.log(error);
/**
 success: false,
 message: "Product name is required",
 code: 400
 * */

When the framework is completed, the document will be made more detailed.

Package Sidebar

Install

npm i @galatajs/core

Weekly Downloads

3

Version

0.1.1

License

MIT

Unpacked Size

19.5 kB

Total Files

41

Last publish

Collaborators

  • ssi-istanbul