open-index/open-npm huggingface dataset:
npm package: @ovieh/field-editor-rich-text
Description: ```bash npm install @contentful/field-editor-rich-text ```
Author: Ovieh Mosley
Latest version: 1.1.7

# @contentful/field-editor-rich-text

```bash
npm install @contentful/field-editor-rich-text
```

This package contains a React `RichTextEditor` component that is used as default for `RichText` field type in the Contentful web application.

This editor app is built on top of [Slate](https://github.com/ianstormtaylor/slate), a third party framework for building highly customizable rich text editing solutions.

```js
import 'codemirror/lib/codemirror.css';
import { RichTextEditor } from '@contentful/field-editor-rich-text';
```
npm package: @ovieh/nestjs-dataloader
Description: A NestJS decorator for dataloader
Author: Ovieh Mosley
Latest version: 2.0.3

# NestJS Dataloader

NestJS dataloader simplifies adding [graphql/dataloader](https://github.com/graphql/dataloader) to your NestJS project. DataLoader aims to solve the common N+1 loading problem.

## Installation

Install with yarn

```bash
yarn add nestjs-dataloader
```

Install with npm

```bash
npm install --save nestjs-dataloader
```

## Usage

### NestDataLoader Creation

We start by implementing the `NestDataLoader` interface. This tells `DataLoader` how to load our objects.

```typescript
import DataLoader from 'dataloader';
import { Injectable } from '@nestjs/common';
import { NestDataLoader } from 'nestjs-dataloader';
...

@Injectable()
export class AccountLoader implements NestDataLoader<string, Account> {
  constructor(private readonly accountService: AccountService) { }

  generateDataLoader(): DataLoader<string, Account> {
    return new DataLoader<string, Account>(keys => this.accountService.findByIds(keys));
  }
}
```

The first generic of the interface is the type of ID the datastore uses. The second generic is the type of object that will be returned. In the above instance, we want `DataLoader` to return instances of the `Account` class.

### Providing the NestDataLoader

For each NestDataLoader we create, we need to provide it to our module.

```typescript
import { Module } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import {DataLoaderInterceptor} from 'nestjs-dataloader'
...

@Module({
  providers: [
    AccountResolver,
    AccountLoader,
    {
      provide: APP_INTERCEPTOR,
      useClass: DataLoaderInterceptor,
    },
  ],

})
export class ResolversModule { }
```

### Using the NestDataLoader

Now that we have a dataloader and our module is aware of it, we need to pass it as a parameter to an endpoint in our graphQL resolver.

```typescript
import DataLoader from 'dataloader';
import { Loader } from 'nestjs-dataloader';
...

@Resolver(Account)
export class AccountResolver {

    @Query(() => [Account])
    public getAccounts(
        @Args({ name: 'ids', type: () => [String] }) ids: string[],
        @Loader(AccountLoader.name) accountLoader: DataLoader<Account['id'], Account>): Promise<Account[]> {
        return accountLoader.loadMany(ids);
    }
}
```

The important thing to note is that the parameter of the `@Loader` decorator is the name of the `NestDataLoader` class we want to be injected to the method. The DataLoader library will handle bulk retrieval and caching of our requests. Note that the caching is stored on a per-request basis.

## Contributing

Pull requests are always welcome. For major changes, please open an issue first to discuss what you would like to change.
npm package: @oviirup/rush
Description: Simple and light-weight CLI tool to run scripts parallelly or sequentially
Author: Avirup Ghosh
Latest version: 1.0.0

# Rush ![](https://img.shields.io/badge/WIP-gold)

![publish](https://github.com/oviirup/rush/workflows/CI/badge.svg)
[![version](https://img.shields.io/npm/v/@oviirup/rush)](https://www.npmjs.com/package/@oviirup/rush)

Simple and lightweight CLI tool to run scripts together in parallel or sequentially.

The built-in `run` command for most of the package managers like `npm run ...`, and `bun run ...` cannot run multiple scripts by design, let alone run it in parallel. You need to create a chain of scripts to run it sequentially, which may not look pretty and redundant.

This tool helps to clear up the multi-script running using _glob patterns_, and also helps to resolve cross-platform script chaining issues.

## Getting started

### Installation

Install it with whatever package manager you like `npm`, `yarn`, or `bun`.

```bash
npm i @oviirup/rush -D
```

It will install the package with binary `rush` and you are all ready to run.

### Usage

`@oviirup/rush` comes with zero-config binary `rush` with the following options...

- `-s` `--serial` : Boolean  
  Run scripts in sequential order
- `-c` `--continue` : Boolean  
  Set the flag to continue executing other tasks even if a task throws an error
- `-m` `--max` : Number  
  Set the maximum number of parallelism. Default is 0 i.e. unlimited
- `-r` `--race` : Boolean  
  Set the flag to kill all tasks when a task finished with zero
- `--silent` : Boolean  
  Set the log level of npm to silent

You can also use the shorthand flags together like `-scr` that translates to `-s -c -r`

### Examples

```bash
$ rush watch:**
$ rush "build:** -- --watch"
$ rush -sr "build:**"
$ rush start-server start-browser start-electron
```

> Note: In some cases, like while using glob patterns you may need to wrap the commands with quotes for them to work properly

## Contributing & Development

You are welcome to contribute to the project. Please follow the [contributing guidelines](/.github/contributing.md) before making any contribution.

- **Fork & clone to local machine**  
  Fork the repo from GitHub by clicking the fork button at the top-right and clone it...

```bash
  git clone https://github.com/oviirup/rush.git
```

- **Create a new branch**  
  Please make sure you are not on the **main** branch before making any changes.

```bash
  git checkout -b my-new-branch
```

- **Install dependencies**  
  This project uses [bun](https://bun.sh/), although any other package manager can be used as well.

```bash
  bun install
```
npm package: @oviirup/utils
Description: Collection of common JavaScript / TypeScript utilities bt @oviirup
Author: Avirup Ghosh
Latest version: 1.0.10

# @oviirup/utils ![](https://img.shields.io/badge/WIP-gold)

Collection of common JavaScript / TypeScript utilities by [@oviirup](https://github.com/oviirup).

- Type-safe utilities for everyday coding
- Zero dependencies
- Thoroughly tested

## Utilities

### assertions

Type guards and assertion functions for runtime type checking.

- **`isString`, `isNumber`, `isInteger`, `isFloat`**: Check value types
- **`isArray`, `isEmptyArray`**: Check array values
- **`isObject`, `isEmptyObject`**: Check object values
- **`isEmpty`**: Check if value is empty, null, undefined, or empty string
- **`isFunction`**: Check if value is a function
- **`isRegex`**: Check if value is a regex
- **`isTruthy`**: Check if value is truthy
- **`isBrowser`**: Check if running in browser environment
- **`not`**: Negate an assertion function

### array

Array manipulation utilities.

- **`toArray(value)`**: Converts a given value to an array
- **`unique(value, matcher?)`**: Create an array with all unique items
- **`at(array, index)`**,
- **`first`**, **`last`**: Get first, and last item of the array
- **`range(start, stop, steps)`**: Generate a range array of numbers
- **`toFiltered(array, predicate)`**: Filter an array, returning a new array with matching items
- **`move(array, fromIndex, toIndex)`**: Move an item in an array to a new position
- **`chunk(array, size)`**: Chunk an array into smaller arrays

### number

Number manipulation utilities.

- **`inRange(value, min, max)`**: Checks if a number is within a range
- **`clamp(value, min, max)`**: Clamps a number between a minimum and maximum value
- **`abbreviate(value, precision?)`**: Abbreviates a number (e.g., 1000 -> 1K)

### object

Object manipulation utilities.

- **`keyInObject(val, key)`**: Checks if a given object has a specified key
- **`pick(object, keys)`**: Picks a set of keys from an object
- **`omit(object, keys)`**: Omits a set of keys from an object

### promise

Promise manipulation utilities.

- **`sleep(delay)`**: Delays execution for a specified number of milliseconds
- **`retry(fn, retries, delay?)`**: Retries a function until it succeeds or max retries reached
- **`tryCatch(input)`**: Wraps a promise and returns a result tuple [value, error]
- **`timeout(fn, duration)`**: Rejects a promise if it doesn't resolve within timeout

### string

String manipulation utilities.

- **`slash`**: Replace backslash to slash
- **`truncate`**: Truncates a string to specified length
- **`toCamelCase`, `toSnakeCase`, `toKebabCase`, `toPascalCase`, `toSentenceCase`, `toTitleCase`**: Convert string case

### nanoid

Secure ID generation.

- **`nanoid(length?, alphabets?)`**: Generate a secure nanoid string