@egyptron/cease 1.0.1 → 1.0.2
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/README.md +74 -0
- package/bin/main.js +1 -1
- package/package.json +1 -1
- package/examples/example_one.cease +0 -2
- package/examples/example_two.cease +0 -5
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Cease 🛑
|
|
2
|
+
|
|
3
|
+
**Cease** is a modern, lightweight Domain Specific Language (DSL) built for Node.js. It is designed to simplify Discord Webhook automation through a clean, readable syntax that can be executed directly from the CLI or via scripted files.
|
|
4
|
+
|
|
5
|
+
**LICENSE: MIT**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **Hybrid Execution**: Run commands directly in your terminal or via `.ce` script files.
|
|
12
|
+
- **Interactive Builder**: Built-in CLI prompts for creating complex Discord Embeds on the fly.
|
|
13
|
+
- **Zero Dependencies**: Lightweight and fast, utilizing native Node.js 2026 APIs.
|
|
14
|
+
- **Global Access**: Once installed via NPM, use the `cease` command from any directory.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🚀 Quick Start
|
|
19
|
+
|
|
20
|
+
### 1. Installation
|
|
21
|
+
Install the Cease interpreter globally using NPM:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g @egyptron/cease
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
# Documentation
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📘 Documentation & Technical Specs
|
|
31
|
+
|
|
32
|
+
### 1. Language Architecture
|
|
33
|
+
Cease is built using a **Recursive Line-Scanner** architecture. Unlike general-purpose languages that use complex Abstract Syntax Trees (AST), Cease uses a high-speed **Pattern Matcher** to identify flags and multi-line properties.
|
|
34
|
+
|
|
35
|
+
### 2. Command Anatomy
|
|
36
|
+
Every Cease command follows this structure:
|
|
37
|
+
`[keyword] "[destination]" [flag] "[data]"`
|
|
38
|
+
|
|
39
|
+
- **Keyword (`cease`)**: The entry point for the interpreter.
|
|
40
|
+
- **Destination**: A double-quoted string containing a valid Discord Webhook URL.
|
|
41
|
+
- **Flags**:
|
|
42
|
+
- `--t`: (Text Mode) Triggers a `content` payload.
|
|
43
|
+
- `--e`: (Embed Mode) Triggers a multi-line `embeds` payload.
|
|
44
|
+
- **Data**: Contextual data (messages or property definitions).
|
|
45
|
+
|
|
46
|
+
### 3. Embed Property Keywords
|
|
47
|
+
When using the `--e` flag in a `.ce` file, the following keywords are reserved:
|
|
48
|
+
|
|
49
|
+
| Keyword | Accepted Value | Purpose |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
| `Title:` | String | Sets the bold header of the embed. |
|
|
52
|
+
| `Desc:` | String | Sets the main body text of the embed. |
|
|
53
|
+
| `Color:` | Hex Code | Sets the sidebar color (e.g., `#7289da`). |
|
|
54
|
+
|
|
55
|
+
### 4. Interactive Mode
|
|
56
|
+
If the `--e` flag is detected in a **Direct Terminal Command** (no `.ce` file provided), Cease enters a **Readline State**.
|
|
57
|
+
1. It pauses the Node.js process.
|
|
58
|
+
2. It opens an asynchronous stream to `stdin`.
|
|
59
|
+
3. It collects user input for each property and compiles them into a JSON object.
|
|
60
|
+
4. It resolves the network request before closing the stream.
|
|
61
|
+
|
|
62
|
+
### 5. Execution Lifecycle
|
|
63
|
+
1. **Normalization**: Code is stripped of whitespace and split into a command array.
|
|
64
|
+
2. **Flag Detection**: The interpreter determines the payload type.
|
|
65
|
+
3. **Payload Construction**: JSON is built according to Discord's API v10 specifications.
|
|
66
|
+
4. **Asynchronous Dispatch**: The `fetch` API sends the POST request.
|
|
67
|
+
5. **Graceful Exit**: The process sets `process.exitCode` to 0 and performs a natural cleanup to prevent Windows libuv errors.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🔒 Security & Requirements
|
|
72
|
+
- **Node.js**: Requires version 20.x or higher (Tested on v24+).
|
|
73
|
+
- **Network**: Requires an active internet connection to reach `discord.com`.
|
|
74
|
+
- **Privacy**: Cease does not log or store Webhook URLs; they are only used for the duration of the execution.
|
package/bin/main.js
CHANGED
|
@@ -15,7 +15,7 @@ async function start() {
|
|
|
15
15
|
// 1. Version Check
|
|
16
16
|
if (args[0] === '--v' || args[0] === '-v') {
|
|
17
17
|
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)));
|
|
18
|
-
console.log(`Cease version
|
|
18
|
+
console.log(`Cease version ${pkg.version} | Successfully Installed`);
|
|
19
19
|
process.exitCode = 0;
|
|
20
20
|
return;
|
|
21
21
|
}
|
package/package.json
CHANGED