open-index/open-npm huggingface dataset:
npm package: @hv-kit/hexpress
Description: facilitates typescript backend development with express
Author: BILONG NTOUBA Célestin
Latest version: 0.0.3-z

# @hv-kit/hexpress

## Presentation

**@hv-kit/hexpress** facilitates typescript backend development with express.

## Installation

```console
npm i @hv-kit/hexpress -s
```

## Use

## Useful links

* [Git](/ "https://ntouba98@bitbucket.org/ntouba98/hexpress.git")
* [Nodejs dependency](/ "https://www.npmjs.com/package/@hv-kit/hexpress")
npm package: @hv-kit/hvscripts
Description: facilitates typescript
Author: BILONG NTOUBA Célestin
Latest version: 0.0.42

# @hv-kit/hvscripts

## Presentation

**@hv-kit/hvscripts** facilitates typescript backend development with express.

## Installation

```console
npm i @hv-kit/hvscripts -s
```

## Use

## Useful links

* [Git](/ "https://ntouba98@bitbucket.org/ntouba98/hvscriptsjs.git")
* [Nodejs dependency](/ "https://www.npmjs.com/package/@hv-kit/hvscriptsjs")
npm package: @hv/datoloader
Description: Dato Loader ===========
Latest version: 3.0.2

Dato Loader
===========

Downloads all data from [DatoCMS](https://www.datocms.com). Data will be simplified. Typescript can be generated.

## Usage

```js
import { writeFile } from 'fs/promises';
import { Loader, generateTypescript } from '@hv/datoloader';

const loader = new Loader(process.env.DATO_API_KEY, {
	onUpdate,
	languages: { de: ['en'] },
});
loader.start();

async function onUpdate(data) {
	await writeFile('data.json', JSON.stringify(data, null, 2));
	await writeFile('data.ts', generateTypescript(firstLang));
}
```

Options:
```js
export interface Options {
	onUpdate: (payload: Result) => void | null
	watch: boolean // keep watching for changes, onUpdate will be called again
	changeKey: (key: string) => string // how to change the keys of the data (default: camelcase)
	languages?: string[] | { [language: string]: string[] } // langauge: fallbackLanguages
	itemVersion: boolean // include item version?
	itemCreatedAt: boolean // include item createdAt?
	itemUpdatedAt: boolean // include item updatedAt?
	environment?: string
	draft?: boolean
	headers?: Record<string, string>
}
```

Please note that the resulting data will be simplified to someting like this:

```json
{
  "de": {
    "itemType": {
      "anotherBlock": {
        "fields": {
          "title": {
            "type": "string",
            "localized": false,
            "required": false
          }
        }
      }
    },
    "site": {
      "name": "Boilerplate",
      ...
    },
    "upload": {
      "54053638": {
        "_id": "54053638",
        "size": 9207613,
        "width": 3840,
        "height": 2160,
        "url": "https://www.datocms-assets.com/99255/1682668783-weitsicht-3840x2160.png",
        ...
      }
    },
    "item": {
      "146161091": {
        "_id": "146161091",
        "_type": "anotherBlock",
        "title": "Just Another",
        "_updatedAt": "2023-04-28T08:02:27.684Z",
        "_createdAt": "2023-04-28T08:02:27.680Z",
        "_version": 267617551
      }
    }
  }
}
```

Later, you can use the generated data and typescript like this:

```js
import { readFile } from 'fs/promises';
import { Result, resolve } from '@hv/datoloader';

export async function loadData() {
	const data = JSON.parse(await readFile('data.json'));
	return resolve(data) as Result;
}
```

Resolving will link actual items to their references. So anything like `items: ["23434232", "23423423"]` will be resolved to `items: [{_id: "23434232", ...}, {_id: "23423423", ...}]`.
npm package: @hv/publish
Description: Publish static website to DEPT.dev
Author: Severin Klaus
Latest version: 3.0.6

HV Publish
==========

Within bitbucket pipelines:

```
yarn run build # build your site
npm install -g hv-publish
save2repo
hv-publish
```
Under the assumption of the build directory being at `./build`.

## Combination Strategy (`hv-publish` and `save2repo`)

`hv-publish` and `save2repo` are very often used in conjunction, but the order may vary:

    - hv-publish
    - save2repo

or

    - save2repo
    - hv-publish

The first should be the normal case. But whatever the order, we want to get most out of the combination:

`hv-publish` should
- publish to Netlify
- save the website info to dept.dev
- save the commit info to dept.dev
    - of the source repository
    - and the build repository

`save2repo` should
- commit to another bitbucket git repository
    - the commit message should include the dept.dev index + commit messages

To make sure this works for both order cases, let's take these steps:

### `hv-publish`, then `save2repo`

- hv-publish
    - publish to Netlify
    - save to dept.dev --> `.hv-publish.json`
- save2repo
    - save to repo, use info of `.hv-publish.json` --> .save2repo.json
    - patch dept.dev

### `save2repo`, then `hv-publish`

- save2repo
    - save to repo, use only commit messages --> `.save2repo.json`
- hv-publish
    - publish to Netlify
    - save to dept.dev, use info of `.save2repo.json`
    - update commit message with info of hv-publish

### Combined

- hv-publish
    - publish to Netlify
    - if `.save2repo.json`
        - save to dept.dev with all info
        - update commit message with info from dept.dev
    - else
        - save to dept.dev without build_repo info
        - save result to `.hv-publish.json`

- save2repo
    - if `.hv-publish.json`
        - commit to repo with info from `.hv-publish.json`
        - patch dept.dev with commit info
    - else
        - commit to repo without dept.dev info (no index)
        - save commit info to `.save2repo.json`
npm package: @hv_react/use-debounced-effect
Description: React useEffect like hook with debouncing
Author: Vikram Raj
Latest version: 0.1.3

# useDebouncedEffect

React useEffect like hook with debouncing

## Install
```bash
npm i @hv_react/use-debounced-effect
```

## Example
```tsx
import React, { FunctionComponent } from "react";
import { useDebouncedEffect } from "@hv_react/use-debounced-effect";

interface Props {}

export const Component: FunctionComponent<Props> = () => {
  useDebouncedEffect(
    () => {}, // effect 
    1000,     // delay in ms
    []        // dependecies
  )
  return <div></div>;
}
```
npm package: @hv_react/use-form
Description: React hook to manage and validate forms
Author: Vikram Raj
Latest version: 0.1.1

# useForm
React hook to manage and validate forms

## Install

```bash
npm i @hv_react/use-form
```

## Example

```tsx
import React, { FunctionComponent } from "react";
import { useForm } from "@hv_react/use-form"

interface Props {}

const validators = {
  name: [
    {
      validateFn: () => true,
      failedValidationMessage: "Invalid name",
    },
  ],
  email: [
    {
      validateFn: isEmail,
      failedValidationMessage: "Invalid email",
    },
  ],
}

export const SomeForm: FunctionComponent<Props> = () => {
  const {values, isValid, changeHandler, dirtyFields, errors} = useForm(
    {
      name: "",
      email: "",
      password: "",
    }, // Initial values
    validators
  )
  return (
    <form>
      <input
        type="text"
        name="name"
        value={values.name}
        onChange={changeHandler}
      />
      {dirtyFields.name && errors.name && (
        <p className="error">{errors.name}</p>
      )}
      
      {/* Other fields */}
    </form>
  );
}
```