-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from scramjetorg/feat/hello-world-ts
hello world writen in ts
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 - | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "hello-world-ts", | ||
"version": "1.0.0", | ||
"description": "Simple Sequence that prints out 'Hello World!' to the Instance output.", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"postbuild": "cp -r package.json dist/ && (cd dist && npm i --omit=dev)", | ||
"clean": "rm -rf ./dist .bic_cache" | ||
}, | ||
"keywords": [ | ||
"easy" | ||
], | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"author": "piotrek6641", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@scramjet/types": "^0.33.5", | ||
"@types/node": "^20.2.3" | ||
}, | ||
"dependencies": { | ||
"typescript": "^5.0.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ "ESNext" ], | ||
"target": "ESNext", | ||
"module": "CommonJS", | ||
"outDir": "./dist", | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"resolveJsonModule": true, | ||
} | ||
} |