@nectar-js/nectar 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tiago Mouta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/nectar-js/nectar/main/assets/NectarFullSmall.png" alt="Nectar" width="192" />
3
+ </p>
4
+
5
+ <h1 align="center">Nectar</h1>
6
+
7
+ <p align="center">A filesystem-based meta-framework for discord.js.</p>
8
+
9
+ <br />
10
+
11
+ Nectar is a framework for Discord bots. You define commands, components, and events as files under `app/`, and Nectar handles command registration, custom ID encoding, and interaction routing.
12
+
13
+ `app/commands/ping/command.ts` registers `/ping`, and `app/commands/moderation/ban/command.ts` registers `/moderation ban`. `app/components/tickets/[ticketId]/close/button.ts` handles a button whose custom ID carries a typed `ticketId`. Handlers get the discord.js interaction and client.
14
+
15
+ ```bash
16
+ npm create @nectar-js
17
+ ```
18
+
19
+ ```ts
20
+ // app/commands/ping/command.ts -> /ping
21
+ import { type CommandMeta, defineCommand } from "@nectar-js/nectar";
22
+
23
+ export const meta: CommandMeta = { description: "Check if the bot is alive" };
24
+
25
+ export default defineCommand("ping", async (ctx) => {
26
+ await ctx.interaction.reply("Pong.");
27
+ });
28
+ ```
29
+
30
+ ```bash
31
+ nectar dev # run the bot, reloading handlers on save
32
+ nectar build # compile to .nectar/
33
+ nectar sync # register commands with Discord
34
+ nectar start # run the compiled build
35
+ ```
36
+
37
+ `nectar --help` lists the rest. The documentation is at [nectar-js.github.io/nectar](https://nectar-js.github.io/nectar/).
38
+
39
+ ## Status
40
+
41
+ Nectar is at 0.x and changes often. Minor versions can break things, so read the [changelog](https://github.com/nectar-js/nectar/blob/main/packages/nectar/CHANGELOG.md) before upgrading.
42
+
43
+ ## Requirements
44
+
45
+ Node.js 22.18 or newer, ESM, discord.js v14. JavaScript projects are supported; the generated route types are TypeScript-only.
46
+
47
+ ## Contributing
48
+
49
+ See [CONTRIBUTING.md](https://github.com/nectar-js/nectar/blob/main/CONTRIBUTING.md).
50
+
51
+ ## License
52
+
53
+ MIT. See [LICENSE](https://github.com/nectar-js/nectar/blob/main/LICENSE).