# qrud

> An opinionated crud library for serverless functions

Latest version **1.0.25** (published 2024-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install qrud
pnpm add qrud
yarn add qrud
bun add qrud
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.25 |
| Published | 2024-03-29 |
| First published | 2023-12-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 56.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | vynci |
| Maintainers | vynci |

## Links

- npm: https://www.npmjs.com/package/qrud
- Repository: https://github.com/vynci/qrud
- Homepage: https://github.com/vynci/qrud#readme
- Issues: https://github.com/vynci/qrud/issues
- npm.io page: https://npm.io/package/qrud

## Dependencies (7)

- [zod](https://npm.io/package/zod.md) ^3.22.4
- [knex](https://npm.io/package/knex.md) ^2.4.2
- [lerna](https://npm.io/package/lerna.md) ^6.4.1
- [rds-data](https://npm.io/package/rds-data.md) ^1.1.0
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^4.0.0
- [change-case](https://npm.io/package/change-case.md) ^4.1.2
- [knex-aurora-data-api-client](https://npm.io/package/knex-aurora-data-api-client.md) ^1.9.0

## Recent versions

- 1.0.25 (latest) — 2024-03-29
- 1.0.24 — 2024-03-28
- 1.0.23 — 2024-03-26
- 1.0.22 — 2024-03-22
- 1.0.21 — 2024-03-22
- 1.0.20 — 2024-03-21
- 1.0.19 — 2024-03-21
- 1.0.18 — 2024-03-18
- 1.0.17 — 2024-03-13
- 1.0.16 — 2024-03-13
- 1.0.15 — 2024-03-13
- 1.0.14 — 2024-03-13
- 1.0.13 — 2024-02-09
- 1.0.12 — 2023-12-28
- 1.0.11 — 2023-12-28
- … 11 more at https://npm.io/package/qrud/versions

## README

# Qrud (pre-alpha)

An opinionated CRUD library made for serverless functions. Aiming to accelerate development by furnishing pre-built methods essential for constructing a robust CRUD API. The ambition is to streamline the development process, empowering developers to focus more on business logic rather than repetitive tasks.

## Development

`$ npm i qrud`

## Use case (AWS Lambda and Appsync GraphQL Sample)

```js
import { Qrud } from "qrud";
import { Todo } from "../../schema/todo";

export const handler = async (event) => {
  try {
    const api = new Qrud({
      schema: Todo,
      table: "todo",
      database: process.env.SQL_DATABASE,
    });

    return await api.gql(event);
  } catch (error) {
    throw new Error(error);
  }
};
```

## Initiate environment variables

`$ export QRUD_SECRET_ARN={AWS SECRET ARN HERE}`

`$ export QRUD_RESOURCE_ARN={AWS RDS CLUSTER ARN}`

`$ export QRUD_REGION={AWS RDS CLUSTER ARN}`

## Unit test

`$ npx jest -- tests/simple.test.ts`

---
_Source: https://npm.io/package/qrud · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
