@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
)
.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,
async object => decode(object.instanceId),
{ "FOO": "BAR" }
)
.then(process => console.log(process))
.catch(error => console.error("error during the compilation", error))