Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello world writen in ts #52

Merged
merged 3 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions typescript/hello-world-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Hello world ts

Simple sequence that outputs "Hello world" written in typescript

## Running

Open the terminal and run the following commands:

```bash
# install dependencies
npm install

# transpile TS->JS to dist/
npm run build

# make a compressed package with Sequence
si seq pack dist

# send Sequence to transform hub, this will output Sequence ID
si seq send dist.tar.gz

# start a Sequence
si seq start -
```
15 changes: 15 additions & 0 deletions typescript/hello-world-ts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { PassThrough } from "stream";
import { ReadableApp } from "@scramjet/types";

const app:ReadableApp<any> = async function(_input) {
patuwwy marked this conversation as resolved.
Show resolved Hide resolved
// create a clean output stream
const out = new PassThrough({ encoding: "utf-8" });

// write some data to the output stream
out.write("Hello World!");

// return the output stream so it can be consumed (e.g. by CLI client)
return out;
};

export default app;
23 changes: 23 additions & 0 deletions typescript/hello-world-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "hello-world-ts",
"version": "1.0.0",
"description": "Simple Sequence that prints out 'Hello World!' to the Instance output.",
"main": "index.js",

patuwwy marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"build": "tsc -p tsconfig.json",
"postbuild": "cp -r package.json dist/ && (cd dist && npm i --omit=dev)",
"clean": "rm -rf ./dist .bic_cache"
},
patuwwy marked this conversation as resolved.
Show resolved Hide resolved
"keywords": [
"easy"
],
"engines": {
"node": ">=14"
},
"author": "piotrek6641",
"license": "ISC",
"devDependencies": {
"@scramjet/types": "^0.33.5"
}
}
12 changes: 12 additions & 0 deletions typescript/hello-world-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"lib": [ "ESNext" ],
"target": "ESNext",
"module": "CommonJS",
"outDir": "./dist",
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
}

patuwwy marked this conversation as resolved.
Show resolved Hide resolved
}
Loading