open-index/open-npm huggingface dataset:
npm package: @sebastian-goat/react-util
Description: Reusable React hooks and context utilities for cleaner, faster development.
Author: sebastian-goat
Latest version: 0.1.3

# react-util

## 📖 Description

This package provides reusable React hooks and context utilities for cleaner, faster development.

## 💯 Getting started

### 🔽 Instalation

```bash
npm install @sebastian-goat/react-util
```

### 📕 API

#### useTheme

A clean solution to handle dark mode in your aplications. It works by toggling classes `'system' | 'light' | 'dark'` on the root (html) element.

Usage:

```tsx
import Page from '@/pages/page';
import { ThemeProvider } from '@sebastian-goat/react-util';

export default function App() {
    
    return (
        <ThemeProvider>
            <Page />
        </ThemeProvider>
    );
}
```

```tsx
import { useTheme } from '@sebastian-goat/react-util';

export default function ThemeToggleButton() {

    const [theme, setTheme] = useTheme();

    return (
        <div className='bg-[var(--bg-card)]'>
            <span>Current theme: {theme}</span>

            <button onClick={() => setTheme('light')}>Change to light</button>
            <button onClick={() => setTheme('dark')}>Change to dark</button>
            <button onClick={() => setTheme('system')}>Change to system</button>
        </div>
    );
}
```

#### useFetch

Sorry, no docs yet. 😭

#### useDebounce

Sorry, no docs yet. 😭

#### useLocalStorage

Sorry, no docs yet. 😭
npm package: @sebastianappelberg/data-scraper
Description: A simple library for scraping web data and extracting structured information using LLMs.
Author: Sebastian Appelberg
Latest version: 0.0.10

# data-scraper

A simple library for scraping web data and extracting structured information using LLMs. 

## Usage

### Scraper

The `Scraper` class allows you to navigate web pages and extract HTML content.

```typescript
import { Scraper, convertToMarkdown } from '@sebastianappelberg/data-scraper';

async function runScrape() {
  const scraper = new Scraper({ headless: true, debug: false });
  try {
    const htmlContent = await scraper.scrape({
      url: 'https://example.com',
      getContent: async (page: Page) => {
        // You must provide a getContent function. 
        return await page.content();
      },
    });
    console.log(htmlContent);

    const markdownContent = convertToMarkdown(htmlContent);
    console.log(markdownContent);
  } finally {
    await scraper.close();
  }
}

runScrape();
```

### Data Extraction

The `extractData` function uses AI to parse and extract structured data from text.

```typescript
import { extractData } from '@sebastianappelberg/data-scraper';

async function runExtraction() {
  const text = `Product: Laptop, Price: $1200, Brand: ExampleTech`;
  const jsonData = await extractData(text, {
    dataStructure: 'JSON',
    prompt: 'Extract product name, price, and brand.',
  });
  console.log(jsonData);
}

runExtraction();
```

## Installation

```
npm install data-scraper
```

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
npm package: @sebastianappelberg/hn-scraper
Description: The HN API doesn't provide the data in a format that's easily consumable. This scraping client solves that.
Author: Sebastian Appelberg
Latest version: 0.0.2

# hn-scraper


## Motivation

The HN API doesn't provide the data in a format that's easily consumable. This scraping client solves that.

## Usage


## Installation


## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
npm package: @sebastianappelberg/local-data
Description: CLI and library for easier management of data stored locally.
Author: Sebastian Appelberg
Latest version: 0.0.10

# local-data

## Motivation

I want to use my local file system as a data lake for all my local data of interest. 

## Usage

Set the `LOCAL_DATA_DIR` environment variable to specify where your data repositories will be stored:

```bash
export LOCAL_DATA_DIR=/path/to/your/data/directory
```

### CLI Commands

```bash
# List all objects in a repository
local-data list <repo>

# Add a new object to the repository
local-data add <repo> <objectName> <objectData>

# Check if an object exists
local-data exists <repo> <objectName>

# Get an object from the repository
local-data get <repo> <objectName> [--encoding <encoding>]

# Link a source file to an object in the repository
local-data link <repo> <objectName> <sourceFilePath>

# Synchronize all linked files in the repository
local-data sync <repo>
```

### Programmatic API

```javascript
import { LocalData } from '@sebastianappelberg/local-data';

const repo = new LocalData('my-repo');

// List objects
const objects = await repo.list();

// Add an object
await repo.add('my-object', 'some data');

// Check if object exists
const exists = await repo.exists('my-object');

// Get an object
const data = await repo.get('my-object');

// Link a file
await repo.link('my-object', '/path/to/source/file');

// Sync all linked files
await repo.sync();
```

## Installation

```
npm install @sebastianappelberg/local-data
```
or

```
yarn add @sebastianappelberg/local-data
```
or
```
pnpm add @sebastianappelberg/local-data
```

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
npm package: @sebastianappelberg/transcriber
Description: TTS with VAD
Author: Sebastian Appelberg
Latest version: 0.0.2

# Transcriber

## Motivation

TTS with VAD comes in handy in more than one project. Therefore, I want to wrap it into a re-usable package. 

## Usage

```
const {wait, proceed} = createWaitProceedSignal();

const transcriber = new Transcriber({
  transcriptionClient: new GoogleTranscriptionClient(),
  onMessage: async message => {
    console.log(message);
  },
  onError: async error => {
    console.error(error);
  }
});

console.log("Recording");
transcriber.start();

const handleExit = () => {
  transcriber.stop();
  process.off("SIGINT", handleExit);
  process.off("SIGTERM", handleExit);
  proceed();
};
process.on("SIGINT", handleExit);
process.on("SIGTERM", handleExit);

await wait;
console.log("Stopped");
```

If you don't want to pass the API key in the TranscriptionClient's constructor you can set the following environment variables:
- For Groq: GROQ_API_KEY
- For OpenAI: OPENAI_API_KEY
- For Google: GEMINI_API_KEY

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
npm package: @sebastianappelberg/ts-kit
Description: General utility functions
Author: Sebastian Appelberg
Latest version: 0.0.10

# ts-kit

Utility functions!

## Motivation

I find myself implementing the same utility functions across many of my projects. This project is meant to collect all
those. Copy-paste the code from here or import it as library. Importing it shouldn't cause too much bloat as I intend to keep
this project dependency free and lightweight.

## Installation

```
npm install @sebastianappelberg/ts-kit
```

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
npm package: @sebastiandg7/local-cors-proxy
Description: Simple proxy to bypass CORS issues. This was built as a local dev only solution to enable prototyping against existing APIs without having to worry about CORS.
Author: Gary Meehan
Latest version: 1.1.1

# Local CORS Proxy

Simple proxy to bypass CORS issues. This was built as a local dev only solution to enable prototyping against existing APIs without having to worry about CORS.

This module was built to solve the issue of getting this error:

```
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disable
```

## Getting Started

```
npm install -g local-cors-proxy
```

**Simple Example**

API endpoint that we want to request that has CORS issues:

```
https://www.yourdomain.ie/movies/list
```

Start Proxy:

```
lcp --proxyUrl https://www.yourdomain.ie
```

Then in your client code, new API endpoint:

```
http://localhost:8010/proxy/movies/list
```

End result will be a request to `https://www.yourdomain.ie/movies/list` without the CORS issues!

Alternatively you can install the package locally and add a script to your project:

```json
 "scripts": {
   "proxy": "lcp --proxyUrl https://www.yourdomain.ie"
 }
```

## Options

| Option         | Example               | Default |
| -------------- | --------------------- | ------: |
| --proxyUrl     | https://www.google.ie |         |
| --proxyPartial | foo                   |   proxy |
| --port         | 8010                  |    8010 |
| --credentials  | (no value needed)     |   false |
| --origin       | http://localhost:4200 |       * |
| --removeRequestOrigin       | http://localhost:4200 |       false |
npm package: @sebastiandittrich/browsershell
Description: This is a revserse shell to a browser session. The goal is that if you inject the given code into the website displayed by the victim, you will have access to his browser console, just like if you were opening the developer tools console.
Author: Sebastian Dittrich
Latest version: 1.0.7

# Browsershell

This is a revserse shell to a browser session. The goal is that if you inject the given code into the website displayed by the victim, you will have access to his browser console, just like if you were opening the developer tools console.

```
npm i -g @sebastiandittrich/browsershell
```

## Example

Start a shell:

```
browsershell shell 192.168.0.10 3001
```

Listen for console output:

```
browsershell console-catcher 192.168.0.10 3002
```