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

starlight-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starlight-api

Starlight Programming Language API Utilities with GET, POST, headers, and auth

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Starlight API Utilities

Developer: Dominex

Description: Starlight API Utilities provide a low-level and flexible HTTP client for the Starlight Programming Language. It supports HTTP and HTTPS requests with JSON handling, headers, authentication, query parameters, timeouts, and reusable API clients.

This package is designed as a foundation utility for building integrations, bots, services, and automation tools with clean and minimal code.

Installation

npm install starlight-api

Import

import api from "starlight-api"

Or using named imports:

import { request, createClient } from "starlight-api"

Basic GET Request

` const response = await api.request({ url: "https://example.com/data" })

print(response.data) `

POST Request with JSON Body

` const response = await api.request({ method: "POST", url: "https://example.com/api", body: { name: "Starlight", version: "1.0.0" } })

print(response.data) `

JSON bodies are automatically converted and parsed.

Query Parameters

const response = await api.request({ url: "https://example.com/search", params: { q: "starlight", page: 1 } })

Custom Headers

const response = await api.request({ url: "https://example.com/secure", headers: { "X-Token": "abc123" } })

Basic Authentication

const response = await api.request({ url: "https://example.com/private", auth: { username: "user", password: "pass" } })

Timeout Control

const response = await api.request({ url: "https://example.com/slow", timeout: 5000 })

Default timeout is 15000 milliseconds.

Using createClient

The createClient function allows you to create a reusable API client with default settings.

` const client = createClient({ baseURL: "https://api.example.com", headers: { "Authorization": "Bearer TOKEN" } })

const users = await client.get("/users") const post = await client.post("/posts", { title: "Hello" }) `

Client Methods

  • client.request(method, path, options) - client.get(path, options) - client.post(path, body, options) - client.put(path, body, options) - client.patch(path, body, options) - client.delete(path, options)

Request Options

  • method – HTTP method (default GET) - url – Full request URL - headers – Custom HTTP headers - body – Request body (object, string, or buffer) - params – Query parameters object - auth – Basic authentication - timeout – Timeout in milliseconds

Response Object

Every request returns an object with:

  • ok – Boolean success status - status – HTTP status code - statusText – HTTP status message - headers – Response headers - data – Parsed response data - raw – Raw response text

Notes

  • Supports HTTP and HTTPS - No external dependencies - JSON handled automatically - Designed for advanced workflows with minimal code - Ideal base for services, bots, and integrations Official Documentation

Keywords

starlight

FAQs

Package last updated on 05 Jan 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