From 4948184d10db3fe40830c90b493100723cf195ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Mendoza=20P=C3=A9rez?= Date: Mon, 5 Apr 2021 16:10:08 +0200 Subject: [PATCH] updated readme.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Antonio Mendoza PĂ©rez --- README.md | 29 ++++++++++++++++++++++++----- package-lock.json | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f95360d..1ed4c29 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Serverless Workflow Specification - Typescript SDK -Provides the Java API/SPI for the [Serverless Workflow Specification](https://github.com/serverlessworkflow/specification) +Provides the Typescript API/SPI for the [Serverless Workflow Specification](https://github.com/serverlessworkflow/specification) With the SDK you can: @@ -15,17 +15,36 @@ With the SDK you can: To build the project and run tests locally: -``` +```sh git clone https://github.com/serverlessworkflow/sdk-typescript.git +cd sdk-typescript npm install && npm run test ``` ### Add as dependency to your project +You can use [npm link](https://docs.npmjs.com/cli/v7/commands/npm-link) to add the `sdk-typescript` +as dependency in your project. + +- Clone the `sdk-typescript` project and build it: ```sh -npm install sdk-typescript +git clone https://github.com/serverlessworkflow/sdk-typescript.git +cd sdk-typescript +npm install && npm run build ``` +- Make the package visible globally to npm. Inside the `sdk-typescript` project folder run: +```sh +npm link +``` + +- Navigate to the folder/project in which you want to use the sdk, and run the following command: +```sh +npm link sdk-typescript +``` + +It will create a symbolic link from globally-installed `sdk-typescript` to `node_modules/` of the current folder. + ### How to use @@ -53,7 +72,7 @@ npm install sdk-typescript ```typescript const workflow = BaseWorkflow.fromSource(source) ``` -Where source is the file location. +Where `source` is the file location. @@ -85,7 +104,7 @@ by using the static methods `toJSON` or `toYAML` respectively: ``` ```typescript - const workFlowAsYAML = BaseWorkflow.toYAML(workflow); + const workflowAsYAML = BaseWorkflow.toYAML(workflow); ``` diff --git a/package-lock.json b/package-lock.json index e097bd3..c444159 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "sdk-ts", + "name": "sdk-typescript", "version": "0.0.1", "lockfileVersion": 1, "requires": true,