open-index/open-npm huggingface dataset:
npm package: @ghom/entity
Description: Suitable to be included in a bundle for Node and the browser for entity based apps
Latest version: 1.0.18

# Entity Base

Suitable to be included in a bundle for Node and the browser for entity based app

## Some specifics

- [@ghom/entity-pixi](https://github.com/GhomKrosmonaute/entity/tree/%40ghom/entity-pixi) for [PixiJS](https://github.com/pixijs/pixijs) *WIP*
- [@ghom/entity-p5](https://github.com/GhomKrosmonaute/entity/tree/%40ghom/entity-p5) for [p5.js](https://github.com/processing/p5.js)

## Annexes

- [Follow tool NEWS](https://discord.gg/kYxDWWQJ8q)
npm package: @ghom/entity-p5
Description: Suitable to be included in a bundle for Node and the browser for entity based apps using p5
Latest version: 1.2.2

# Entity p5

Suitable to be included in a bundle for Node and the browser for entity based app using p5.js

## Library usage

Start from template ? [https://github.com/ESBuildTemplates/entity-p5.ts](ESBuildTemplates/entity-p5.ts) (recommended)

### Startup example

The following Rect instance extends Entity

```ts
// TypeScript
import { Entity, Rect } from "@ghom/entity-p5"

/**
 * It is recommended to isolate root entity in another file to be able to import it wherever you want
 */
const root = new Entity

function setup() {
  const myRect = new Rect(
    x, y,
    width,
    height
  ).setStyle(() => {
    noStroke()
    fill("red")
  })
  
  // add my rect to root entity children.
  // my rect will drawn/setup/update/teardown at same time of root.
  root.addChild(myRect)
  
  root.setup()
}

function draw() {
  root.update(true)
  root.draw()
}
```

### Example with heritage

The following class uses the onUpdate method of her parent.  
The onDraw method is already implemented in some entities. 

```ts
// TypeScript
import { Entity, Circle } from "@ghom/entity-p5"

/**
 * Juste a clickable balloon that teleports
 */
export class ClickableBalloon extends Circle {
  constructor() {
    super(
      random(0, width),  // x
      random(0, height), // y
      random(40, 60)     // diameter
    )
  }

  /**
   * Setup dynamic styles
   */
  onSetup() {
    this.setStyle(() => {
      fill(
        random(100, 200), // red
        random(100, 200), // green
        random(100, 200)  // blue
      )
      if(this.isHovered) {
        stroke(255)
        strokeWeight(5)
      } else noStroke()
    })
  }

  /**
   * Prevent the user from being able to click on multiple balloons at the same time
   */
  onMouseReleased() {
    if (this.isHovered) {
      if (this.parent.children.length > 1)
        this.parent.stopTransmission("mouseReleased")

      this.parent.addChild(new Balloon())
      this.teardown()
    }
  }
}

/**
 * It is an Entity used as container containing other entities
 */
export class Balloons extends Entity {
  constructor(private count: number) {
    super()
  }

  onSetup() {
    for (let i = 0; i < this.count; i++) {
      this.addChild(new ClickableBalloon())
    }
  }
}
```
npm package: @ghom/entity-pixi
Description: Suitable to be included in a bundle for Node and the browser for entity based apps using pixi.js
Latest version: 1.0.1

# Entity for PixiJS

Suitable to be included in a bundle for Node and the browser for entity based app using pixi.js

## Library usage

Start from template ? [https://github.com/ESBuildTemplates/entity-pixi.ts](ESBuildTemplates/entity-pixi.ts) (recommended)

### Startup example

```ts
// Comming soon
```
npm package: @ghom/handler
Description: File handler with real hot-reload for Node.js
Latest version: 3.1.0

# File handler

This package is a file handler for NodeJS. It can load files from a directory, and it can reload the files if they changed.
You can handle any file type with this handler, but you need to write a loader function for it.

## Basic usage

```ts
import { Handler } from "@ghom/handler"

const handler = new Handler(" ... ") 

try {
  // For load the files, call this function:
  await handler.init()

  // You can access the loaded files with the "elements" property:
  console.log(handler.elements)
} catch(e) {
  console.error(e)
}

// For terminate the hot reloading and empty the handler cache, call this function:
handler.destroy()
```

## Config example for simple JS module handler

```ts
export const handler = new Handler("dist/files", {
  logger: console,
  loggerPattern: "loaded new table: $filename",
  loader: (path) => import(`file://${path}`),
  pattern: /\.js$/,
})

```

## Config example for js module handler with hot reloading

```ts
export const handler = new Handler("dist/files", {
  pattern: /\.js$/,
  hotReload: true,
  loader: (path) => import(`file://${path}?update=${Date.now()}`),
  onLoad: (path, data) => {
    // Do something with the loaded data
  },
  onChange: (path, data) => {
    // Do something with the changed data
  },
})
```

The `?update=${Date.now()}` text part is important if you want to import the changed file with the hot reloading.

## Same example but with CommonJS

```ts
const handler = new Handler("dist/files", {
  pattern: /\.js$/,
  hotReload: true,
  loader: (path) => {
    delete require.cache[require.resolve(path)]
    return require(path)
  },
  // ...
})
```

The `delete require.cache[require.resolve(path)]` line is important if you want to require the changed file with the hot reloading.

## Example for simple file handler (for txt files)

```ts
import fs from "fs"

const handler = new Handler("dist/files", {
  pattern: /\.txt$/i,
  hotReload: true,
  loader: async (filepath) => {
    return fs.promises.readFile(filepath, "utf8")
  },
})
```
npm package: @ghom/programmatic-seo
Description: Programmatic S.E.O tools for NodeJS
Latest version: 0.1.2

# Programmatic SEO Library for Node.js

This Node.js library is designed to empower developers with the tools needed to automate and enhance their SEO efforts programmatically.

## Installation

To install the programmatic SEO library, use npm:

```bash
npm install @ghom/programmatic-seo
```

## Usage

Here's a quick example to get you started:

```js
import { combination } from "@ghom/programmatic-seo"

const output = combination({
  pattern: "{verb} [{adjective}] approach of {noun}",
  data: {
    verb: ["learn", "explore"],
    adjective: ["exciting", "innovative"],
    noun: ["programming", "[web] development"]
  }
})

console.log(output)

// Output:
// [
//   "learn exciting approach of programming",
//   "learn exciting approach of development",
//   "learn exciting approach of web development",
//   "learn innovative approach of programming",
//   "learn innovative approach of development",
//   "learn innovative approach of web development",
//   "explore exciting approach of programming",
//   "explore exciting approach of development",
//   "explore exciting approach of web development",
//   "explore innovative approach of programming",
//   "explore innovative approach of development",
//   "explore innovative approach of web development"
// ]
```

## API Documentation

### `combination(options: CombinationOptions): string[]`

Generates a list of strings based on the provided pattern and data. `CombinationOptions` includes `pattern` and `data`.

### `combinationGenerator(options: CombinationOptions): Generator<string>`

Gives a generator of strings based on the provided pattern and data. `CombinationOptions` includes `pattern` and `data`.

## Contributing

We welcome contributions from the community! If you'd like to contribute to the project, make a PR 😉

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @ghom/utils
Description: Javascript utils
Latest version: 1.1.4

# Javascript utils

## Install

```bash
npm install @ghom/utils
```

## Usage

```javascript
import "@ghom/utils"
```

## Added methods

- `<RegExp>.matches()` - returns an array of matches
- `<Array>.pick()` - returns an array of objects with only the specified keys
- `<Array>.omit()` - returns an array of objects without the specified keys
- `<Array>.partition()` - return a tuple of two arrays, filtered by the predicate
npm package: @ghom/web-scrapper
Description: Simple web scrapper using query selectors
Author: ghom
Latest version: 1.0.2

# Javascript utils

## Install

```bash
npm install @ghom/web-scrapper
```

## Usage

```javascript
import { scrap } from '@ghom/web-scrapper'

// with callback
scrap("https://www.google.com", null, (data, err) => {
    if (err) return console.error(err)
    console.log(data.window.document.querySelector("title").innerHTML)
})

// with promise
const data = await scrap("https://www.google.com")
console.log(data.window.document.querySelector("title").innerHTML)
```
npm package: @ghost-nft/eth-ghost-sdk
Description: 🛠 An SDK for building applications on top of Pancakeswap.
Author: ghostpow
Latest version: 1.0.67

# Pancakeswap SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancake-swap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @ghost-nft/ghost-eslint-config
Description: Eslint config for Ghost
Author: ghostpow
Latest version: 1.0.0

# ghost-eslint-config

- Airbnb config
- Typescript
- Prettier

## Usage

```
npx install-peerdeps --dev @ghost-nft/ghost-eslint-config
```

Add `"extends": "@ghost-nft/ghost-eslint-config"` to your eslint config file.
npm package: @ghost-nft/ghost-sdk
Description: 🛠 An SDK for building applications on top of Pancakeswap.
Author: ghostpow
Latest version: 1.0.30

# Pancakeswap SDK

Forked from the [Uniswap SDK](https://github.com/Uniswap/uniswap-v2-sdk/commit/a88048e9c4198a5bdaea00883ca00c8c8e582605).

You can refer to the Uniswap SDK documentation [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancake-swap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @ghost-nft/ghost-uikit
Description: Set of UI components for ghost projects
Author: ghostpow
Latest version: 1.0.21

# Ghost UIkit

[![Version](https://img.shields.io/npm/v/@ghost-nft/ghost-uikit)](https://www.npmjs.com/package/@ghost-nft/ghost-uikit)

[![Size](https://img.shields.io/bundlephobia/min/@ghost-nft/ghost-uikit)](https://www.npmjs.com/package/@ghost-nft/ghost-uikit)

Ghost UIkit is a set of React components and hooks used to build pages on Ghost's apps.
It also contains a theme file for dark and light mode.

## Install

`yarn add @ghost-nft/ghost-uikit`

## Setup

### Theme

Before using Ghost UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@ghost-nft/ghost-uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@ghost-nft/ghost-uikit'
...
<ResetCSS />
```

### Types

This project is built with Typescript and export all the relevant types.