open-index/open-npm huggingface dataset:
npm package: @harmonix-js/core
Description: 🤖 Open-source framework to make Discord bots.
Latest version: 0.3.2
Deprecated: This package has been replaced by 'harmonix'. Please migrate to the new package.

[![Harmonix banner](./.github/assets/banner.svg)](https://harmonix-js.netlify.app)

<p align=center>
  <a href="https://www.npmjs.com/package/@harmonix-js/core"><img src="https://img.shields.io/npm/v/@harmonix-js/core?style=flat&colorA=191717&colorB=304ffe" alt="Version"></a>
  <a href="https://www.npmjs.com/package/@harmonix-js/core"><img src="https://img.shields.io/npm/dm/@harmonix-js/core.svg?style=flat&colorA=191717&colorB=304ffe" alt="Downloads"></a>
  <a href="./LICENSE"><img src="https://img.shields.io/github/license/harmonix-js/core.svg?style=flat&colorA=191717&colorB=304ffe" alt="License"></a>
  <a href="https://harmonix-js.netlify.app"><img src="https://img.shields.io/badge/Harmonix%20Docs-18181B?logo=gitbook&logoColor=304ffe" alt="Website"></a>
  <a href="https://discord.gg/A3rVnG4JGV"><img src="https://img.shields.io/badge/Harmonix%20Discord-18181B?logo=discord&logoColor=304ffe" alt="Discord"></a>
</p>

# Harmonix

Open-source framework to make Discord bots.

## ⚡ Quick Start

This will set up a starter project with all the required files and dependencies:

```bash
npx @harmonix-js/cli init <my-bot>
```

## 🤖 Development

Harmonix offers a straightforward, user-friendly, and robust solution for writing commands naturally. It automates all repetitive tasks, allowing you to concentrate on developing your bot features with assurance.

Example of a `commands/ping.ts`:

```ts
import { defineCommand } from '@harmonix-js/core'

export default defineCommand(
  {
    description: 'Ping command'
  },
  (client, interaction) => {
    interaction.reply('Pong!')
  }
)
```

## 📖 Documentation

Check out the Harmonix documentation to enhance your skills. It's an excellent resource for deepening your understanding of the framework, covering a large bunch of topics.

## 🤝 Contribution

We welcome your support to enhance Harmonix. To do that you can report bugs or give us feedback and ideas.

## ⚖️ License

Published under the [MIT](https://github.com/harmonix-js/core/blob/main/LICENSE) license.

## 🌱 Contributors

<a href="https://github.com/harmonix-js/core/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=harmonix-js/core" />
</a>
npm package: @harmonixjs/cli
Description: CLI for Harmonix Discord framework
Author: Maxence Bessi
Latest version: 1.0.0

# @harmonixjs/cli

CLI tool for the **Harmonix Discord framework**.  
Quickly initialize projects, generate commands, events, and components for your Discord bot.

---

## Installation

You can use `npx` to run the CLI without installing it globally:

```bash
npx @harmonixjs/cli <command>
```

Or install globally:

```bash
npm install -g @harmonixjs/cli
```

## Usage

### 1. Initialize a new project

Creates a new Harmonix bot project with the recommended structure:

```bash
npx @harmonixjs/cli init
```

This will generate:
- Project folder with `src` directorie
- Base configuration files
- Initial bot setup

---

### 2. Create a new component

Generates commands, events, or components using predefined templates:

```bash
npx @harmonixjs/cli create
```

This will generate the respective file in the appropriate folder with boilerplate code ready to use.

## Project Structure

After initializing, your project will look like this:

```pgsql
project/
├─ node_modules/
├─ src/
│  ├─ commands/
│  ├─ events/
│  ├─ components/
│  └─ index.ts
├─ .env
├─ package-lock.json
├─ package.json
└─ tsconfig.json
```

- `src/` - your TypeScript source code
- `src/index.ts` - basic index.ts file
- `.env` - default environment configuration


## Contributing

Feel free to open issues or submit pull requests.
Please follow the code style and structure used in the templates.
If you create some plugins you could open issues or submit pull requests to add your plugins/cli features.
npm package: @harmonograph/xy
Description: Generate a harmonographs X and Y coordinates
Author: Alex Page
Latest version: 0.0.0

# @harmonograph/xy

> 👩‍🎨 Generate a harmonographs X and Y coordinates


## Install

```shell
npm install @harmonograph/xy
```


## Get started

The harmonograph is a mechanical apparatus that uses pendulums to create a geometric image. This function uses the drawing time, size and pendulums to create X and Y coordinates for a harmonograph.

If you wish to draw the harmonograph for use on a website you can use `@harmonograph/svg` or `@harmonograph/canvas`.


### Create harmonograph XY coordinates

```js
const generateHarmonographXY = require('@harmonograph/xy');

const harmonograph = generateHarmonographXY(
  150,
  700,
  [{
    amplitude: 200, frequency: 2.985, phase: 2.054, damping: 0.001
  },
  {
    amplitude: 200, frequency: 3.006, phase: 1.820, damping: 0.008
  },
  {
    amplitude: 200, frequency: 3.003, phase: 2.283, damping: 0.001
  },
  {
    amplitude: 200, frequency: 1.994, phase: 1.155, damping: 0.001
  }]
);
```

This returns an object containing an array of X and Y coordinates. When drawn these points create a harmonograph.

```js
{
  x: [1, 2, 3],
  y: [1, 3, 9]
}
```


### Create randomised harmonograph XY coordinates

```js
const generateHarmonographXY = require('@harmonograph/xy');
const {randomPendulums} = require('@harmonograph/xy');

const harmonograph = generateHarmonographXY(150, 700, randomPendulums());
```


## Options

| Option | Description | Default value | Type |
| --- | --- | --- | --- |
| drawingTime | How long the pendulum swings in seconds | `150` | _number_ |
| size | The size of the svg | `700` | _number_ |
| pendulums | Two pendulums require four items ( x, y and x, y ). Each X and Y value is an object that contains _amplitude_, _frequency_, _phase_, and _damping_ ( see pendulum options below ) | `random values` | _array_ |


## Pendulums object

| Parameter | Description | Default value | Type |
| --- | --- | --- | --- |
| pendulum.amplitude | How far a pendulum swings back and forth, must be from `0` - `360` degrees | `random number` | _number_ |
| pendulum.frequency | How fast a pendulum swings back and forth, for best results use decimal values around `2` and `3` | `random number` | _number_ |
| pendulum.phase | The rate that a pendulum loses its energy, or slows down, must be from `0` to `π` | `random number` | _number_ |
| pendulum.damping | The offset from the normal starting position of a pendulum, must be from `0` to `0.01` | `random number` | _number_ |


## Release History

* v0.0.0  - 💥 Initial version