5.0.0 • Published 3 years ago

@liteflow/compiler v5.0.0

Weekly downloads
29
License
ISC
Repository
github
Last release
3 years ago

@liteflow/compiler

This library let you compile your services and/or processes.

Contents

Installation

npm install @liteflow/compiler

Service

Warning: The service compilation doesn't produce a ready to publish result. At the end of the compilation you will still need to add the source attribute with the hash of the tarball of the sources of your service on IPFS.

const fs = require('fs')
const compiler = require('@liteflow/compiler')

const serviceFileBuffer = fs.readFileSync('./liteflow.yml')

compiler.service(
  serviceFileBuffer // Buffer of your service file `fs.readFileSync('./liteflow.yml')`
)
  .then(service => console.log(service))
  .catch(error => console.error("error during the compilation", error))

Process

const fs = require('fs')
const { decode } = require('@liteflow/api/lib/util/base58')
const compiler = require('@liteflow/compiler')

const processFile = fs.readFileSync('./my-process.yml')

compiler.process(
  processFileBuffer,                            // Buffer of your process file `fs.readFileSync('./my-process.yml')`
  async object => decode(object.instanceId),    // InstanceResolver, can be use to simply decode an instance id or do some check/deployment
  { "FOO": "BAR" }                              // Map of environment variable that will be replaced in your process
)
  .then(process => console.log(process))
  .catch(error => console.error("error during the compilation", error))
5.0.0

3 years ago

4.2.1

4 years ago

4.2.0

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-alpha.0

4 years ago

1.2.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.2

4 years ago

11.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago