New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

starlight-cli

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starlight-cli

Starlight Programming Language CLI

latest
npmnpm
Version
1.1.20
Version published
Weekly downloads
134
436%
Maintainers
1
Weekly downloads
 
Created
Source

Starlight Language Guide

Welcome to Starlight Language, a simple and expressive server-side scripting programming language designed for clarity and flexibility.

This guide introduces the core concepts and syntax to help you start writing programs quickly.

1. Hello World

sldeploy "Hello, world!"

2. Variables

Variables are declared using the define keyword.

define name = "Alice"
define age = 20

Supported Value Types

TypeExample
Number10, 3.14
String"hello"
Booleantrue, false
Array[1, 2, 3]
Object{ "a": 1, "b": 2 }
Nullnull

3. Output

Use sldeploy to print values:

sldeploy name
sldeploy age

4. Input

Use ask to read user input:

define name = ask("Enter your name:")
sldeploy "Hello " + name

5. Operators

Arithmetic Operators

OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulus

Example:

define result = 10 + 5 * 2

Comparison Operators

OperatorDescription
==Equal
!=Not equal
<Less than
<=Less than or equal
>Greater than
>=Greater than or equal

Logical Operators

OperatorDescription
ANDLogical AND
ORLogical OR
??Null coalescing

Example:

define x = null ?? 10

6. Conditional Statements

if (age > 18) {
    sldeploy "Adult"
} else {
    sldeploy "Minor"
}

7. Loops

While Loop

define i = 0

while (i < 5) {
    sldeploy i
    i = i + 1
}

For Loop

for (define i = 0; i < 5; i = i + 1) {
    sldeploy i
}

For-In Loop

define arr = [10, 20, 30]

for x in arr {
    sldeploy x
}

8. Functions

Function Declaration

func add(a, b) {
    return a + b
}

Function Usage

define result = add(2, 3)
sldeploy result

Arrow Functions

define add = (a, b) => a + b

9. Arrays

define arr = [1, 2, 3]

sldeploy arr[0]

Common Array Operations

FunctionDescription
pushAdd element
popRemove last element
push(arr, 4)
pop(arr)

10. Objects

define user = {
    "name": "Alice",
    "age": 20
}

sldeploy user.name

11. Slicing

define arr = [1, 2, 3, 4, 5]

sldeploy arr[1:4]
sldeploy arr[0:5:2]

Slice Syntax

FormatDescription
[start:end]Basic slicing
[start:end:step]Step-based slicing

12. Error Handling

do {
    define x = y
} track {
    sldeploy "Error occurred"
}

13. Imports

import math from "math"

Supported Imports

TypeDescription
.sl filesLocal modules
Node.js modulesExternal dependencies

14. Built-in Functions

Examples:

len([1,2,3])
upper("hello")
random(1, 10)

Categories

CategoryExamples
Stringupper, lower
Arraypush, pop
Mathrandom
Utilitylen

15. Asynchronous Code

define data = await get("https://api.example.com")
sldeploy data

16. Object Construction

func Person(name) {
    this.name = name
}

define p = new Person("Alice")
sldeploy p.name

17. Comments

# This is a comment

18. Language Notes

BehaviorDescription
Undefined valuesTreated as null
Function returnDefaults to null if unspecified
Data structuresDynamic (arrays and objects)
Error reportingIncludes line and column details

19. Next Steps

  • Explore built-in functions
  • Write small programs
  • Review full syntax reference
  • Experiment with custom scripts

Keywords

starlight language, scripting language, programming language tutorial, interpreter language, CLI scripting, custom language design

Keywords

starlight

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts