starlight-cli 1.0.28 → 1.0.30
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 +71 -0
- package/package.json +1 -4
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Starlight Language
|
|
2
|
+
|
|
3
|
+
Starlight is a lightweight, developer-oriented programming language designed for server-side scripting, automation, and general-purpose programming. It combines simplicity with powerful features like async/await, custom modules, and a clear, concise syntax.
|
|
4
|
+
|
|
5
|
+
**Official Reference:** [https://starlight-learn-lang.pages.dev/](https://starlight-learn-lang.pages.dev/)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Modern Syntax: Inspired by JavaScript and Python, optimized for server-side tasks.
|
|
10
|
+
- Async/Await Support: Handle asynchronous operations cleanly.
|
|
11
|
+
- Modules & Imports: Use `import` to bring in libraries or other `.sl` files.
|
|
12
|
+
- Server-side Ready: Ideal for scripting, automation, and backend logic.
|
|
13
|
+
- Interactive Input: Built-in `ask` and `sldeploy` commands for user interaction.
|
|
14
|
+
- Built-in Utilities: `sleep(ms)`, `len()`, `keys()`, `values()`, `fetch()`, `get()`, `post()`.
|
|
15
|
+
|
|
16
|
+
## Getting Started
|
|
17
|
+
|
|
18
|
+
1. Install Node.js (v18+ recommended)
|
|
19
|
+
2. Install via NPM:
|
|
20
|
+
|
|
21
|
+
\`\`\`
|
|
22
|
+
npm install starlight-cli
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
## Example Program (`hello.sl`)
|
|
26
|
+
|
|
27
|
+
\`\`\`
|
|
28
|
+
let name = ask("What is your name?")
|
|
29
|
+
sldeploy("Hello, " + name + "!")
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
Run:
|
|
33
|
+
|
|
34
|
+
\`\`\`
|
|
35
|
+
starlight hello.sl
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
Output:
|
|
39
|
+
|
|
40
|
+
\`\`\`
|
|
41
|
+
What is your name? Alice
|
|
42
|
+
Hello, Alice!
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
## Server-side Example
|
|
46
|
+
|
|
47
|
+
\`\`\`
|
|
48
|
+
define server = async () => {
|
|
49
|
+
let response = await get("https://jsonplaceholder.typicode.com/todos/1")
|
|
50
|
+
sldeploy(response)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
server()
|
|
54
|
+
\`\`\`
|
|
55
|
+
|
|
56
|
+
## Core Concepts
|
|
57
|
+
|
|
58
|
+
- Variables: `let x = 10`
|
|
59
|
+
- Functions: `func add(a, b) { return a + b }`
|
|
60
|
+
- Async Functions: `async func fetchData() { ... }`
|
|
61
|
+
- Conditionals: `if (x > 5) { ... } else { ... }`
|
|
62
|
+
- Loops: `while`, `for`
|
|
63
|
+
- Modules: `import { something } from "./module.sl"`
|
|
64
|
+
|
|
65
|
+
## Why Starlight?
|
|
66
|
+
|
|
67
|
+
Starlight is developer-focused, designed for server-side scripting and automation. Its clean syntax and minimal overhead make it easy to write powerful scripts.
|
|
68
|
+
|
|
69
|
+
For full tutorials, API references, and examples, visit: [https://starlight-learn-lang.pages.dev/](https://starlight-learn-lang.pages.dev/)
|
|
70
|
+
|
|
71
|
+
License: MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starlight-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"description": "Starlight Programming Language CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"starlight": "index.js"
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
},
|
|
12
12
|
"author": "Macedon",
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"os": [
|
|
15
|
-
"win32"
|
|
16
|
-
],
|
|
17
14
|
"dependencies": {
|
|
18
15
|
"blessed": "^0.1.81",
|
|
19
16
|
"readline-sync": "^1.4.10"
|