TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published


This package is part of Scramjet Transform Hub. The package holds utility functions used in places around Scramjet Transform Hub.

This package includes domain agnostic utility functions, meaning there shouldn't be any business use-case specific code here. It's important since a package like this one tends to be a very common dependency for other packages. Ideally functions from this package should be written once, well tested and never changed.


Example of a GOOD function for this package

This function does not have any knowledge of business components in the system and it's simple. Thus it's pretty stable.

export const defer = (timeout: number): Promise<void> =>
    new Promise(res => setTimeout(res, timeout));

Example of a BAD function for this package

Knowledge about different types of streams on our platform indicates that this function defines a business logic.

import { EncodedMonitoringMessage, WritableStream } from "@scramjet/types";

export class MessageUtils {
    public static writeMessageOnStream([code, data]: EncodedMonitoringMessage, streamToWrite?: WritableStream<any>){
        if (streamToWrite === undefined) {
            throw new Error("The Stream is not defined.");

        streamToWrite.write(JSON.stringify([code, data]) + "\r\n");


See the code documentation here: scramjetorg/transform-hub/docs/types/modules.md

Scramjet Transform Hub

This package is part of Scramjet Transform Hub.

Scramjet Transform Hub is a deployment and execution platform. Once installed on a server, it will allow you to start your programs and keep them running on a remote machine. You will be able to start programs in the background or connect to them and see their output directly on your terminal. You will be able to pipe your local data to the program, as if it was running from your terminal. You can start your server in AWS, Google Cloud or Azure, start it on your local machine, install it on a Raspberry Pi or wherever else you'd like.

Some important links

License and contributions

This module is licensed under AGPL-3.0 license.

The Scramjet Transform Hub project is dual-licensed under the AGPL-3.0 and MIT licenses. Parts of the project that are linked with your programs are MIT licensed, the rest is AGPL.


We accept valid contributions and we will be publishing a more specific project roadmap so contributors can propose features and also help us implement them. We kindly ask you that contributed commits are Signed-Off git commit --sign-off.

We provide support for contributors via test cases. If you expect a certain type of workflow to be officially supported, please specify and implement a test case in Gherkin format in bdd directory and include it in your pull request. More info about our BDD test you will find here.

Help wanted 👩‍🎓🧑👱‍♀️

The project need's your help! There's lots of work to do and we have a lot of plans. If you want to help and be part of the Scramjet team, please reach out to us, on discord or email us: opensource@scramjet.org.

Donation 💸

Do you like this project? It helped you to reduce time spent on delivering your solution? You are welcome to buy us a coffee ☕ Thanks a lot! 😉

You can sponsor us on github

  • There's also a Paypal donation link if you prefer that:





Package Sidebar


npm i @scramjet/utility

Weekly Downloads






Unpacked Size

182 kB

Total Files


Last publish


  • patu
  • scramjetorg
  • michalcz
  • stoq