Sequence that modifies incoming stream of strings by adding a prefix and a suffix.
Open two terminals and run the following commands:
The first terminal:
# go to 'transform-string-stream' directory cd typescript/transform-string-stream # install dependencies npm install # transpile TS->JS to dist/ npm run build # deploy the Sequence from the dist/ directory, which contains transpiled code, package.json and node_modules si seq deploy dist --args [\"Woogie \",\"Boogie\"] # See output of Instance process si inst output -
deployperforms three actions at once:
startthe Sequence. It is the same as if you would run those three commands separately:
si seq pack dist/ -o transform-string-stream.tar.gz # compress 'transform-string-stream/' directory into file named 'transform-string-stream.tar.gz' si seq send transform-string-stream.tar.gz # send compressed Sequence to STH, this will output Sequence ID si seq start - --args '["Hello ", "Bye!"]' # start the Sequence with arguments, this will output Instance ID
The second terminal
# Send file to the Instance input steam si inst input - name.txt # the date will be read from the file 'name.txt'
# Send text to the Instance input steam si inst input - > Michael # if file not given the data will be read from stdin
# Now you should see "Hello John Bye" in output console $ si inst output - Hello Michael Bye!