open-index/open-npm huggingface dataset:
npm package: @hedgewizard.dev/random-facts
Description: Random dinosaur facts generator
Author: Troy Ciesco
Latest version: 0.2.0

# @hedgewizard.dev/random-facts

[![npm version](https://badge.fury.io/js/%40hedgewizard.dev%2Frandom-facts.svg)](https://badge.fury.io/js/%40hedgewizard.dev%2Frandom-facts)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A simple utility package that provides random dinosaur facts.

## Installation

```bash
npm install @hedgewizard.dev/random-facts
```

## Usage

```typescript
import { getFact } from '@hedgewizard.dev/random-facts';

// Get a random dinosaur fact
const fact = getFact();
console.log(fact);
// Output: "Tyrannosaurus rex had teeth up to 8 inches long, but they were shaped like bananas rather than sharp knives."

// Get multiple facts
for (let i = 0; i < 3; i++) {
  console.log(`${i + 1}. ${getFact()}`);
}
```

## API

### `getFact(): string`

Returns a random dinosaur fact from an internal collection of 10 facts.

**Returns:** A string containing a random dinosaur fact.

**Example:**
```typescript
const fact = getFact();
console.log(typeof fact); // "string"
console.log(fact.length > 0); // true
```

## Features

- 🦕 10 carefully curated dinosaur facts
- 🎲 Uses `Math.random()` for randomness (no external dependencies)
- 📝 Written in TypeScript with full type definitions
- 🧪 Thoroughly tested with Vitest
- 📦 Zero dependencies
- 🔒 Immutable fact collection

## License

MIT © [Hedgewizard.dev](https://hedgewizard.dev)

## Contributing

This package is part of the [hw-utils](https://github.com/troyciesco/hw-utils) monorepo. Please see the main repository for contribution guidelines.
npm package: @hedhog/prisma
Description: <p align="center">   <img src="https://avatars.githubusercontent.com/u/177489127?s=200&v=4" alt="Hedhog Avatar" /> </p>
Latest version: 0.51.2

# <p align="center">hedhog/prisma</p>

<p align="center">
  <img src="https://avatars.githubusercontent.com/u/177489127?s=200&v=4" alt="Hedhog Avatar" />
</p>

**Hedhog Prisma** is a HedHog module that extends [**Prisma**](https://prisma.io/) Client to integrate seamlessly with HedHog projects. It provides an enhanced PrismaClient with additional methods for identifying the database provider and checking the type of database in use.

## Purpose

The Hedhog Prisma module is designed to simplify interactions with Prisma by adding convenience methods and ensuring proper database connection management within HedHog projects. It enhances the Prisma Client with functionality specific to HedHog’s requirements, including database provider detection and connection handling.

## Features

- **Database Connection Management**: Automatically connects to the database when the module is initialized.
- **Provider Detection**: Provides methods to detect the type of database provider being used (e.g., [**PostgreSQL**](https://www.postgresql.org/) or [**MySQL**](https://www.mysql.com/)).

## Installation

This library is an integral part of the HedHog framework and should be installed as a dependency in your HedHog project. Ensure that the necessary dependencies are configured in your HedHog project.

```bash
npm i @hedhog/prisma
```

## Methods

**onModuleInit()**: Automatically connects to the database when the module initializes.

**getProvider()**: Returns the active database provider (e.g., 'postgresql', 'mysql').

**isPostgres()**: Returns true if the active database provider is PostgreSQL.

**isMysql()**: Returns true if the active database provider is MySQL.

## Folder Structure

```plaintext
prisma/
├── dist/                        # Compiled JavaScript file from build
├── node_modules/                # Discardable folder with all module dependencies
├── src/
│   ├── index.ts                  # Entry point for PrismaService
│   ├── prisma.module.ts          # Module definition (if needed)
│   └── prisma.service.ts         # Service class extending PrismaClient
│   ├── prisma.service.spec.ts    # Unit tests for PrismaService
├── .gitignore                    # Specifies which file Git should ignore
├── package.json                  # Manages dependencies and scripts for the library
├── package-lock.json             # Lock file for dependencies
├── README.md                     # Documentation for the library
├── tsconfig.lib.json             # TypeScript configuration for library builds
├── tsconfig.production.json      # TypeScript configuration for production builds
```
npm package: @hediet/debug-visualizer-data-extraction
Description: A library that helps implementing data extractors for the Debug Visualizer VS Code extension.
Author: Henning Dieterichs
Latest version: 0.14.0

# @hediet/debug-visualizer-data-extraction

[![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)

A library that helps implementing data extractors for the Debug Visualizer VS Code extension.
It will automatically be injected by the extension when the debugger attaches.
Compatible with NodeJS and browsers.

# Installation

Use the following command to install the library using yarn:

```
yarn add @hediet/debug-visualizer-data-extraction
```

# Usage

## `createGraphFromPointers` Helper

```ts
import { createGraphFromPointers } from "@hediet/debug-visualizer-data-extraction";

setTimeout(() => {
	new Main().run();
}, 0);

class Main {
	run() {
		const list = new DoublyLinkedList("1");
		list.setNext(new DoublyLinkedList("2"));
		list.next!.setNext(new DoublyLinkedList("3"));
		list.next!.next!.setNext(new DoublyLinkedList("4"));

		// Watch `visualize()` with the Debug Visualizer Extension for VS Code!
		const visualize = () =>
			// Returns `CommonDataTypes.Graph` data which can be visualized by
			// either the vis.js or the graphviz visualizer.
			createGraphFromPointers({ list, last, cur }, i => ({
				id: i.id,
				label: i.name,
				color: finished.has(i) ? "lime" : undefined,
				edges: [
					{ to: i.next!, label: "next" },
					{ to: i.prev!, label: "prev", color: "lightgray" },
				].filter(r => !!r.to),
			}));

		const finished = new Set();
		var cur: DoublyLinkedList | undefined = list;
		// Reverses `list`. Finished nodes have correct pointers,
		// their next node is also finished.
		var last: DoublyLinkedList | undefined = undefined;
		while (cur) {
			cur.prev = cur.next;
			cur.next = last;
			finished.add(cur);
			last = cur;
			cur = cur.prev;
		}
		console.log("finished");
	}
}

let id = 0;
class DoublyLinkedList {
	public readonly id = (id++).toString();
	constructor(public name: string) {}

	next: DoublyLinkedList | undefined;
	prev: DoublyLinkedList | undefined;

	public setNext(val: DoublyLinkedList): void {
		val.prev = this;
		this.next = val;
	}
}
```

![](../docs/doubly-linked-list-reverse-demo.gif)

## Registering Custom Data Extractors

```ts
import { getDataExtractorApi } from "@hediet/debug-visualizer-data-extraction";

getDataExtractorApi().registerExtractor({
	id: "my-foo-extractor",
	getExtractions: (data, collector) => {
		if (data instanceof Foo) {
			collector.addExtraction({
				id: "my-foo-extraction",
				name: "My Foo Extraction",
				priority: 2000,
				extractData: () => ({ kind: { text: true }, text: "Foo" }),
			});
		}
	},
});

setTimeout(() => {
	new Main().run();
}, 0);

class Foo {}

class Main {
	run() {
		const f = new Foo();
		// if `f` is watched by the Debug Visualizer,
		// `my-foo-extractor` will provide the data for the visualizers.
		// See `CommonDataTypes` for data types that have built in visualizers.
		debugger;
	}
}
```
npm package: @hediet/json-to-dictionary
Description: Converts json to a list of stringified key value pairs and back.
Author: Henning Dieterichs
Latest version: 0.2.1

# JSON to Dictionary

[![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)

# Install

To install the library:

```
yarn add @hediet/json-to-dictionary
```
npm package: @hediet/live-debug
Description: Provides services to send events to a debugger that supports live debug.
Author: Henning Dieterichs
Latest version: 0.6.0

# @hediet/live-debug

[![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)

TODO: Improve Readme.
See [`./src`](./src) for the source, it is documented and there isn't much.

You can get the VS Code extension [here](https://marketplace.visualstudio.com/items?itemName=hediet.live-debug-vscode).

## ChangeLog

-   0.5.0 Version Upgrade
npm package: @hediet/node-reload
Description: [![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)
Author: Henning Dieterichs
Latest version: 0.10.0

# Hot Reloading for NodeJS

[![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)

A thoughtfully designed library that brings advanced hot reloading to NodeJS.

## Features

-   Tracks a dependency graph (files in `node_modules` and there like can be ignored).
-   Tracked files are watched for changes.
-   If a file has changed, reconcilers try to apply the change to the running app on a module basis.
-   If a reconciler is not successful, the reconcilers of the dependees are asked to apply the change.

## Usage

### Installation

```
yarn add @hediet/node-reload
```

or

```
npm install @hediet/node-reload --save
```

See the `./examples` folder for detailed examples.
Works best with TypeScript.

### Hot Reload Exported Items

`hotReloadExportedItem` makes it very easy to track changes of exported items.

```ts
import { enableHotReload } from "@hediet/node-reload/node"; // This import needs nodejs.

// Call this before importing modules that should be hot-reloaded!
enableHotReload({
	entryModule: module, // only this module and its transitive dependencies are tracked
	logging: 'debug', // useful for debugging if hot-reload does not work
});

import { hotReloadExportedItem } from "@hediet/node-reload"; // This import is bundler-friendly and works in any environment!
import { myFunction } from './dep1';

const d = hotReloadExportedItem(myFunction, myFunction => {
	// Runs initially and on every change of `myFunction`
    console.log('myFunction: ' + myFunction());
	return {
		dispose: () => {
			console.log('cleanup');
		}
	}
});
// ...
d.dispose();

```

## Similar libs

-   [node-hot](https://github.com/mihe/node-hot): Inspired this library.

## Changelog

-   0.0.2 - Initial release.
-   0.4.2 - Implements Live Debug
-   0.10.0 - Rewrite. Focus on `hotReloadExportedItem` and more portable code.
npm package: @hediet/semantic-json
Description: Highly experimental. Do not use yet.
Author: Henning Dieterichs
Latest version: 0.4.2

# Semantic Json

A library for reflectable runtime validation of json values.
A mix of io-ts and JSON Schema.
This library is still in its early development. The API is not yet final.

## Features

## Installation

```
yarn add @hediet/semantic-json
```

## Basic Usage

The most important concept of this library is the serializer.
A serializer can deserialize JSON to a typed value and serialize the value back to JSON.
All functions to construct serializers start with an `s`.

Serializers can be composed, as the following example demonstrates:

```ts
// All serializers start with an `s`.
import {
	sObject,
	sString,
	sArrayOf,
	optionalProp,
} from "@hediet/semantic-json";
import { expect } from "chai";

const contactBook = sArrayOf(
	sObject({
		firstName: sString(),
		lastName: sString(),
		city: optionalProp(sString(), {
			description: "The city where the contact lives in.",
		}),
	}),
	{ minLength: 1 }
);

expect(() => {
	const value = contactBook
		.deserialize([{ firstName: "Test" }])
		// getValidValue throws and complains that "lastName" is missing.
		.getValidValue();
	// value is of type { firstName: string, lastName: string, city?: string }[]
	console.log(value[0].firstName, value[0].lastName);
}).to.throw();
```

##

## Generating TypeScript Declaration Types

To generate typescript declaration types, it is recommended to name the serializers.
The `TypeScriptTypeGenerator` will be moved to its own package at some later point.

```ts
import {
	sObject,
	sString,
	sArrayOf,
	namespace,
	TypeScriptTypeGenerator,
} from "@hediet/semantic-json";

const myNs = namespace("demo.org");

class Contact {
	constructor(private firstName: string, private lastName: string) {}

	public toString() {
		return `${this.firstName} ${this.lastName}`;
	}
}

const contact = sObject({
	firstName: sString(),
	lastName: sString(),
});

const contactBook = sArrayOf(contact.defineAs(myNs("Contact"))).defineAs(
	myNs("ContactBook")
);

const g = new TypeScriptTypeGenerator();
const tsType = g.getType(contactBook);
equal(tsType, "ContactBook");
equal(
	g.getDefinitionSource(),
	`type ContactBook = (Contact)[];

type Contact = {
    firstName: string;
    lastName: string;
    /**
     * The city where the contact lives in.
     */
    city?: string;
};`
);
```
npm package: @hediet/semver
Description: A typed implementation of the Semantic Version 2.0.0 specification.
Author: Henning Dieterichs
Latest version: 0.2.2

# @hediet/semver - TypeScript Implementation of The Semantic Version Specification

[![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev)

A sane TypeScript implementation of the [Semantic Version specification 2.0.0](https://semver.org/spec/v2.0.0.html).
Some features are still missing but will be implemented eventually.

## Install

To install the library:

```
yarn add @hediet/semver
```

## Features

-   Parse/Stringify versions
-   Modify/Increment versions
-   Versions are immutable

## Examples

```js
const ver = SemanticVersion.parse("1.0.0-alpha.1");
equal(ver.major, 1);

const ver1 = ver.with({ prerelease: null });
equal(ver1.toString(), "1.0.0");

const ver2 = ver.with({ patch: "increment" });
equal(ver2.toString(), "1.0.1-alpha.1");

const ver3 = ver.with({ patch: "increment", prerelease: null });
equal(ver3.toString(), "1.0.1");
```
npm package: @hediet/visualization-bundle
Description: Bundles several visualizers
Latest version: 0.2.5

# Visualization Bundle

This package registers various visualizations. If you have an idea for a cool visualization, add it here!

## Installation

You can use yarn to install this library:

```
yarn add @hediet/visualization-bundle
```

Install `@hediet/visualization-core` before!

## Usage

Import `@hediet/visualization-bundle` to register all default visualizations to `globalVisualizationFactory` of `@hediet/visualization-core`:

```tsx
// This registers all visualizations
import "@hediet/visualization-bundle";
```

Don't forget to import the styles in your scss file:

```scss
@import "~@hediet/visualization-bundle/style.scss";
```

You will need to configure webpack

-   to compile scss files:

```js
{ test: /\.scss$/, loader: "style-loader!css-loader!sass-loader" },
```

-   to compile less files:

```js
{ test: /\.less$/, loaders: ["style-loader", "css-loader", "less-loader"] }
```

-   to register monaco workers

```js
plugins: [
	// ...
	new MonacoWebpackPlugin({
		languages: ["typescript", "json"],
	}),
];
```

See docs of `@hediet/visualization-core` for how to find and render visualizations!

## Supported Visualizations

You can find a playground that demonstrates all visualizations [here](https://hediet.github.io/visualization/).

### Source Visualizations

-   Tree Visualizer
-   AST Visualizer (+ Monaco Source Code View)
-   Grid Visualizer
-   SVG Visualizer
-   Image Visualizer
-   Simple Text Visualizer

### Integrated Visualization Libraries

-   Plotly Visualizer
-   Perspective JS Visualizer
-   VisJS Visualizer
-   Graphviz Graph Visualizer
-   Graphviz Dot Visualizer
-   Vis.js Visualizer
-   Monaco Editor Source Code Visualizer

## Setup Local Development Copy

-   Clone this repository.
-   Run `yarn` in the root folder.
-   Run `yarn dev` in the `visualization-bundle` folder to start tsc in watch mode.
-   Edit [./playground/src/visualization.ts](../playground/src/visualizations.ts) to your needs to improve webpack performance. This is highly recommended, but not required.
-   Run `yarn dev` in the `playground` folder to start the playground where you can debug your visualization.

Any changes to the source are now reflected in the playground!

## Implementing New Visualizations

First, setup your local development copy.

You can use the [`simple-text-visualizer`](./src/visualizers/simple-text-visualizer/index.tsx) as starting point!
Just copy the folder, rename the ids and names, export it [here](./src/visualizers/index.ts) and read through all the comments of the simple-text-visualizer!

Use the "open" button in the playground to debug your new visualization!

## Machine Readable Documents

-   [TypeScript Declarations](https://hediet.github.io/visualization/docs/visualization-data.ts)
-   [JSON Schema](https://hediet.github.io/visualization/docs/visualization-data-schema.json)
npm package: @hediet/visualization-core
Description: Provides infrastructure to find registered visualizations for given json data
Author: Henning Dieterichs
Latest version: 0.3.1

# Visualization Core

## Installation

You can use yarn to install this library:

```
yarn add @hediet/visualization-core
```

You may want to install `@hediet/visualization-bundle` for the actual visualizations too!

## Usage

Use `globalVisualizationFactory` to visualize some data:

```tsx
import { globalVisualizationFactory } from "@hediet/visualization-core";

const data = {
	kind: { graph: true as true },
	nodes: [
		{ id: "1", label: "1" },
		{ id: "2", label: "2", color: "orange" },
		{ id: "3", label: "3" },
	],
	edges: [
		{ from: "1", to: "2", color: "red" },
		{ from: "1", to: "3" },
	],
};

const visualizations = globalVisualizationFactory.getVisualizations(
	data,
	/* preferred visualization id */ undefined
);
// `visualizations.bestVisualization` is the visualization that is best suited to visualize the data.
// `visualiztaions.allVisualizations` contains all suitable visualizations.
```

If you use react, you can use the `VisualizationView` component to render a visualization:

```tsx
import { VisualizationView, Theme } from "@hediet/visualization-core";

// const visualizations = ...

function App() {
	if (!visualizations.bestVisualization) {
		return null;
	}
	return (
		<VisualizationView
			theme={Theme.light}
			visualization={visualizations.bestVisualization}
		/>
	);
}
```

## Architecture

![](./architecture.drawio.svg)
npm package: @hedone/react-echart
Description: <h1 align="center">echart-for-rc</h1>
Author: jackqian
Latest version: 0.3.0

<h1 align="center">echart-for-rc</h1>

<div align="center">

An simple React wrapper for Apache ECharts.

Includes some specific type templates.

</div>

[![](./static/example.png)](example)

English | [简体中文](./README-zh_CN.md)

## ✨ Features

- 🛡 Written in TypeScript with predictable static types.
- 🌈 Implemented using react hooks.
- 📦 For more friendly hint, base on Echarts V5 .
- 🎨 Auto decide how to import required extensions then do more optimization for bundle size.
- ⚙️  support JSX event style.

## 📦 Install

```bash
npm install @hedone/react-echart
```

```bash
yarn add @hedone/react-echart
```

## 🔨 Usage


```jsx
import { Bar } from '@hedone/react-echart';

const App = () => (
  <>
    <Bar 
      options={{
        title: {
          text: 'Tesla',
          subtext: 'Fuck Data',
          left: 'center',
        },
        tooltip: {
          trigger: 'item',
        },
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        },
        yAxis: {
          type: 'value',
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar',
            showBackground: true,
            backgroundStyle: {
              color: 'rgba(180, 180, 180, 0.2)',
            },
          },
        ],
      }}
    />
  </>
);
```

or

```tsx
import { Bar } from '@hedone/react-echart';
import type { BarOptions } from '@hedone/react-echart';

const App = () => {

  const options: BarOptions = {
    title: {
      text: 'Tesla',
      subtext: 'Fuck Data',
      left: 'center',
    },
    tooltip: {
      trigger: 'item',
    },
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        data: [120, 200, 150, 80, 70, 110, 130],
        type: 'bar',
        showBackground: true,
        backgroundStyle: {
          color: 'rgba(180, 180, 180, 0.2)',
        },
      },
    ],
  }
  return (
    <Bar 
      options={options}
    />
  )
};
```

## TypeScript

`react-echart` base on latest stable TypeScript Version（>=4.6.3）.

## ⌨️ Development

clone locally:

```bash
$ git clone git@github.com:jay0815/react-echart.git
$ cd react-echart
$ pnpm install
```
npm package: @hedonicadapter/genv
Description: CLI to scan your project for env variable usage and generate .env template files
Latest version: 0.1.0

# genv

`genv` scans your codebase for environment variable usage and generates or updates an env template file.

## Install

```bash
npm install -g genv
```

Or run without installing globally:

```bash
npx genv
```

## Usage

```bash
genv [options]
```

### Options

- `--out <path>`: Output file path (default: `.env.template`)
- `--include <glob>`: Include glob (default: `src/**/*.{js,ts,jsx,tsx}`)
- `--exclude <glob>`: Exclude glob (default: `node_modules/**`)
- `--optional-prefix <str>`: Prefix that marks optional env vars (default: `OPTIONAL_`)
- `--dry-run`: Print generated content instead of writing file
- `-h, --help`: Show help text

## Examples

Generate a default template:

```bash
genv
```

Write to `.env.example` and scan all source files:

```bash
genv --out .env.example --include "**/*.{js,ts,jsx,tsx}" --exclude "**/*.test.*"
```

Preview output without writing:

```bash
genv --dry-run
```

## Merge behavior

When the output file already exists:

- Existing lines are preserved as-is, including comments and current values.
- New keys are appended under `# --- Auto-added ---`.
- Duplicate keys are not re-added.

## Release workflow (maintainers)

1. Update `CHANGELOG.md`.
2. Bump version: `npm version patch|minor|major`.
3. Push commit and tag.
4. Run `npm publish` manually, or use the GitHub Actions workflow on release tags.

## Development

```bash
npm install
npm test
npm run pack:check
```