diff --git a/README.md b/README.md index dfef856..f149321 100644 --- a/README.md +++ b/README.md @@ -360,3 +360,24 @@ It is described in a `.json` file, like such: "items": [] } ``` + +## Long running processes + +Most examples of using import-utilities library assume that you're using it as a CLI tool. In that case the execution of `.kill()` method is optional. However, if you want to use import-utilities in a long running process (for example in a web server) then you have to use this method like in the following example: + +```typescript +... +public async importProductsAsync(spec: JsonSpec): Promise { + const bootstrapper = new Bootstrapper(); + + bootstrapper.setAccessToken("", ""); + bootstrapper.setTenantIdentifier(""); + bootstrapper.setFallbackFolderId(""); + + bootstrapper.setSpec(spec); + + await bootstrapper.start(); + await bootstrapper.kill(); +} +... +```