Scramjet Framework and Platform

website·Indexed 33 days ago

https://docs.scramjet.org/

A data-oriented framework for building 'Sequences'—small, asynchronous programs deployed as 'Transform as a Service'. The platform includes the Scramjet Cloud Platform (SCP) API, a CLI tool (`si`), and a framework supporting TypeScript and Python. It features specialized stream types such as :DataStream, :BufferStream, :NumberStream, and :MultiStream for functional data transformations and distributed parallel processing in JavaScript.

Tokens
52.7K
Snippets
333
Records
471
Agent score
62%

What's inside Scramjet

  1. Overview of Scramjet Cloud Platform (SCP)

    The Scramjet Cloud Platform (SCP) is a tool for streaming data and executing remote processes across distributed environments. It allows for the concurrent execution of programs written in JavaScript, TypeScript, and Python. The platform is designed to handle various data formats, including images, videos, and streams, while maintaining a low memory footprint via the Scramjet Transform Hub.
  2. Overview of Scramjet NumberStream

    NumberStream is a specialized Scramjet stream designed for handling numbers or objects that implement a valueOf method. Because it extends DataStream, it supports all standard stream operations such as map and reduce, while adding numeric-specific utility methods.
  3. Overview of Scramjet Stream Classes

    Scramjet provides several specialized stream classes to handle different data types. These streams support writing, reading, or transform modes (exclusively). Scramjet optimizes performance by chaining multiple transforms (e.g., .map().map().filter()) into a single transform stream rather than creating multiple intermediate streams.

    Available stream classes:

    • DataStream: Basic object stream of any type.
    • StringStream: Stream of strings.
    • BufferStream: Stream of buffers.
    • NumberStream: Stream of numbers.
    • WindowStream: Stream of windows of objects.
    • MultiStream: A group of streams.
  4. Overview of Scramjet application templates

    Scramjet provides predefined templates to help users apply standard settings and quickly start building stream-processing applications. Templates are available for the following languages:

    • JavaScript (node)
    • TypeScript (ts-node)
    • Python
  5. Overview of BufferStream

    BufferStream is a facilitation stream designed for easy splitting or parsing of buffers. It is particularly useful for processing built-in Node.js streams (such as those from files) or parsing binary formats.
    const fs = require('fs');
    const { BufferStream } = require('scramjet');
    
    fs.createReadStream("pixels.rgba")
      .pipe(new BufferStream()) // pipe a buffer stream into scramjet
      .breakup(4) // split into 4 byte fragments
      .parse((buffer) => [
        buffer.readInt8(0), // the output is a stream of R,G,B and Alpha
        buffer.readInt8(1), // values from 0-255 in an array.
        buffer.readInt8(2),
        buffer.readInt8(3),
      ]);
  6. Overview of Scramjet Cloud Platform and Sequences

    Scramjet Cloud Platform simplifies the integration of cloud and local processing systems, removing the need for complex VPNs or public API gateways. A core feature is 'Sequences'—long-lived cloud functions designed for high-performance data processing. Key benefits include:

    • No execution time limits (unlike standard 15-minute cloud provider limits).
    • Sub-millisecond reaction times.
    • Built-in data flow controls that process data in chunks to prevent system overload.
  7. Overview of StringStream

    StringStream is a specialized DataStream designed for handling streams of string objects. It extends the base DataStream functionality to provide string-specific transformations.
    StringStream.from(async () =>
      (await fetch("https://example.com/data/article.txt")).text()
    )
      .lines()
      .append("\r\n")
      .pipe(fs.createWriteStream("./path/to/file.txt"));
  8. Overview of WindowStream

    WindowStream is a static class that extends NumberStream. It represents a stream of arrays, where each array is a 'window' of items. It is typically created using the DataStream..window method and is used to perform moving window calculations.
  9. Overview of Scramjet Transform Hub

    Scramjet Transform Hub (STH) is a container supervisor that enables the deployment, execution, and monitoring of applications on the Scramjet Cloud Platform. It runs locally on the server where it is installed and does not rely on external systems. It currently supports programs written in Node.js and Python.
  10. Overview of Integ-Master integration

    Integ-Master is a component designed to provide integration between Stripe, Auth0, and Mailchimp services, managing Stripe and Auth0 as sources. For the system to operate properly, two sequences are required: Integ-Master and ChimpInsert. Users should start with the ChimpInsert directory before configuring Integ-Master.
  11. Overview of the StreamWorker class

    The StreamWorker class is intended for internal use within the Scramjet framework. It provides low-level control over subprocesses, specifically handling the spawning of workers, communication between processes, and the delivery of data streams to child processes.
  12. Overview of repo-checker sequence capabilities

    The repo-checker sequence retrieves the following metrics from supported platforms:

    • Docker Hub: Pull Count, Stars
    • GitHub: Weekly Stars, Weekly Views
    • PyPi: Weekly Downloads
    • Npm: Weekly Downloads