open-index/open-npm huggingface dataset:
npm package: @oluwabukunmi/credo
Description: **Credo Auth** is a lightweight, configurable authentication middleware for **Express.js** applications.
Author: oluwabukunmi
Latest version: 0.0.4

# 🚀 Credo Auth

**Credo Auth** is a lightweight, configurable authentication middleware for **Express.js** applications.

It provides a complete, reusable auth system with JWT (access + refresh tokens), email OTP verification, password reset, rate limiting, and MongoDB persistence — without forcing you into a rigid framework.


# Usage
```Javascript
import express from "express";
import { createAuthSystem } from "@your-npm-username/credo";
import mongodb from "mongodb";
import createAuthSystem from "@oluwabukunmi/credo";
import fs from "fs"
import path from "path"
import clientPromise from "./src/config/mongodbconfig.js";
import { createMongoAuthAdapter } from "@oluwabukunmi/credo/adapters";
import { createResendMailProvider } from "@oluwabukunmi/credo/mailProviders"

const app = express();

app.use(express.json());

app.use(express.urlencoded({ extended: true }));

const client = await clientPromise
const db = client.db("example")

const privateKey = fs.readFileSync(
    path.join(process.cwd(), "keys/private.key"),
    "utf8"
);

const publicKey = fs.readFileSync(
    path.join(process.cwd(), "keys/public.key"),
    "utf8"
);


app.use(
  "/api/auth",
  createAuthSystem({
    jwt: {
      publicKey,      
      privateKey,          
    },
     crud: createMongoAuthAdapter(db), 

    rateLimit: {
      login:        [5, "15 min"],//[minutes , max requests]
      register:     [5, "15 min"],
      logout:       [10, "15 min"],
      refreshToken: [10, "15 min"],
      forgotPassword: [3, "10 min"],
      resetPassword:  [5, "10 min"],
    },
      sendMail: createResendMailProvider(process.env.RESEND_API_KEY, process.env.EMAIL_FROM),
      mode: process.env.NODE_ENV === "production" ? "production" : "development",
    })
);

app.listen(3000, () => console.log("Server running on port 3000"));

```
npm package: @oluwasemilore/node-starter-kit
Description: starter kit to boostrap nodejs projects
Author: oluwasemilore
Latest version: 1.0.3

# Node Starter Kit - Documentation

Node Starter Kit is a command-line interface (CLI) tool that allows developers to quickly bootstrap Node.js projects. It provides a set of utilities to copy project files, initialize a Git repository, and install project dependencies.

## Installation

To install Node Starter Kit, you need to have Node.js and npm (Node Package Manager) installed on your system. Once you have Node.js installed, open your terminal and run the following command:

`npm install -g @oluwasemilore/node-starter-kit`

## Usage

After installing Node Starter Kit, simply run the command in the project directory using the following command:

`node-starter-kit template [options]`

### Templates

The templates include:

- `JavaScript`: Bootstrap a JavaScript project.
- `TypeScript`: Bootstrap a TypeScript project.

### Options

- `--git`, `-g`: Initialize a Git repository in the project directory.
- `--yes`, `-y`: Skip all prompts and use default options.
- `--install`, `-i`: Automatically install project dependencies after creating the project.

## Examples

### Create a new JavaScript project:

`node-starter-kit`

This will prompt you to choose a project template (JavaScript or TypeScript) and whether to initialize a Git repository. And won't run npm install

### Create a JavaScript project with Git initialized and dependencies installed:

`node-starter-kit javascript --git --install`

This will create a new JavaScript project, initialize a Git repository, and automatically install project dependencies.

## Project Structure

The generated project will have the following structure:

```bash
project-name/
├── src/
├── package.json
```

## Contributing

We welcome contributions from the community! If you find any bugs or have suggestions for new features, please open an issue on the [GitHub repository](https://github.com/oluwasemilorebadejo/node-starter-kit/issues).

The TypeScript template hasn't been implemented yet. Feel free to contribrute.

To contribute to the codebase, follow these steps:

1. Fork the repository on GitHub.
2. Clone your forked repository to your local machine.
3. Create a new branch for your changes.
4. Make your changes and commit them with descriptive commit messages.
5. Push your changes to your forked repository.
6. Create a pull request from your branch to the main repository.

## License

Node Starter Kit is released under the MIT License. See [LICENSE](https://github.com/oluwasemilorebadejo/node-starter-kit/blob/main/LICENSE) for more details.

## Credits

Node Starter Kit is developed and maintained by Oluwasemilore Badejo.
npm package: @olvrcc/what-the-script
Description: A small utility that prints all the scripts for a given project.
Author: Cameron Olivier
Latest version: 1.0.0

# WHAT THE SCRIPT!?

This is a small little npm package that will output all the scripts for a given project.

## Installation

```bash
npm install -g @olvrcc/what-the-script
```

## Usage

Simply run the following command in the root of your project:

```bash
$ wts
```

## License

Include a `LICENSE` file to specify the licensing terms for your project.
npm package: @oly_op/pg-helpers
Description: pg-helpers
Author: Oliver Plummer
Latest version: 7.3.0

# pg-helpers

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]

pg-helpers is a wrapper library for the popular [node-postgres](https://node-postgres.com/) library (`pg` npm package). It adds many utilities including a `query` function that makes inserting variables and parameters a lot easier in my opinion. It does this by using a simple template mechanism in your SQL code that allows you to insert a variable or a parameter.

## Installation

```sh
$ npm install @oly_op/pg-helpers
```

## Usage

`@oly_op/pg-helpers` re-exports everything from `pg`.

### types

```typescript
import type { Pool, PoolClient, QueryResult as ResultBase } from "pg";

export type PoolOrClient = Pool | PoolClient;
export type Row = Record<string, unknown>;
export type Result<T = Row> = ResultBase<T>;
```

### query helpers

#### `query`

```typescript
// definition
query(client: PoolOrClient) =>
  (sql: string) =>
    <T>(input?: QueryOptions<T> | undefined) =>
      Promise<T>;

// types
export type VariableType = string | number | boolean | null

export interface Variable {
  key: string,
  value: VariableType,
  parameterized?: boolean,
}

export type VariableInput = Variable[] | Record<string, VariableType>

export type Parse<T> = (result: Result) => T

export interface QueryOptionsLog {
  sql?: boolean,
  result?: boolean,
  variables?: boolean,
}

export interface QueryOptions<T> {
  parse?: Parse<T>,
  log?: QueryOptionsLog,
  variables?: VariableInput,
}

// example #1
interface User {
  name: string,
  userID: string,
}

const getUser =
  async (userID: string) =>
    query(context.pg)(`
      SELECT
        {{ columnNames }}
      FROM
        users
      WHERE
        user_id = '{{ userID }}'
    `)({
      parse: convertFirstRowToCamelCase<User>(),
      variables: {
        userID,
        columnNames: join(["user_id", "name"]),
      },
    })

console.log((await getUser("1234")).name)
```

[downloads-image]: https://img.shields.io/npm/dm/@oly_op/pg-helpers.svg
[downloads-url]: https://npmjs.org/package/@oly_op/pg-helpers
[npm-image]: https://img.shields.io/npm/v/@oly_op/pg-helpers.svg
[npm-url]: https://npmjs.org/package/@oly_op/pg-helpers
npm package: @oly_op/uuid-dashes
Description: uuid-dashes
Author: Oliver Plummer
Latest version: 1.0.0

# pg-helpers
A wrapper library for the [pg](https://www.npmjs.com/package/pg) npm package.

## Installation
`npm install @oly_op/pg-helpers`

## Usage
The package exports helpers which you can import individually.

`import {  query, parseTable } from "@oly_op/pg-helpers"`

## API

Query function
* `query`

Result parsing helpers:
* `parseRow`
* `parseTable`
* `getResRow`
* `getRowCount`
* `getResExists`
* `getRowCountOrNull`
* `isResEmpty`
* `convertToCamelCase`
* `convertToSnakeCase`

Types:
```typescript
import type { Pool, PoolClient, QueryResult } from "pg"

export type Client = Pool | PoolClient

export type QueryRes<T = Record<string, unknown>> = QueryResult<T>

export type Parse<T> = (res: QueryRes) => T

export interface Variable {
	key: string,
	string?: boolean,
	parameterized?: boolean,
	value: string | number | boolean | null,
}
```