Skip to main content

Samples 📚

We have prepared some samples for you that show the different uses of a Sequence. Some are super simple, some are a little more advanced. They show the use of data from various resources, such as local disk, external API, or plain keyboard input. The samples are differentiated according to language in which they were written. Every sample contains a short readme with a guidance describing the procedure for running the example as well as is linked to its source code on GitHub. Please take a look at our samples and if you have any questions or difficulties, feel free to ask us on Discord.

The execution will be performed using Scramjet's command-line interface CLI.

Prerequisites​

Sample execution requires prior environment preparation and installations.

Environment​

You can run each sample either on your Self Hosted Hub or Scramjet Cloud Platform. Choose the most suitable for you and follow the link that provides installation tips and guidelines:

Command Line Interface​

Samples execution will be performed from the command line using our CLI, which full description you will find in our official documentation website in CLI Reference section, or run si --help command where you have everything in a nutshell.

You can install the si command from npm using the following command:

npm i -g @scramjet/cli

Repository​

Please clone Scramjet's platform-samples GitHub repository:

git clone https://github.com/scramjetorg/platform-samples.git

Hello

Sequence that modifies incoming stream of strings by adding Hello.

Hello-World-Js

Simple Sequence that prints out 'Hello World!' to the Instance output.

Json-Url-Output

Sequence that pulls data from JSON url every x seconds and writes it to Instance output endpoint.

Json-Url-Stdout

Sequence that pulls data from JSON url every x seconds and writes it to Instance stdout endpoint.

Pokemon

A Sequence that reads incoming data via input stream, then based on that data, a request is sent to external API.

Simple-Counter-Js

A simple Sequence, that counts and logs the number in 1s intervals.

Test-Output

Sequence that writes random values to output stream.

Was it helpful?

Didn't find information needed?

Join our Scramjet Community on Discord, where you can get help from our engineers directly.