This package has been deprecated

Author message:

Please use @liteflow/compiler

@mesg/compiler
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@mesg/compiler

Website - Docs - Forum - Chat - Blog

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

Contents

Installation

npm install @mesg/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('@mesg/compiler')

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

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

Process

const fs = require('fs')
const { decode } = require('@mesg/api/lib/util/base58')
const compiler = require('@mesg/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.instanceHash),  // InstanceResolver, can be use to simply decode an instance hash 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))

Readme

Keywords

none

Package Sidebar

Install

npm i @mesg/compiler

Weekly Downloads

0

Version

0.2.0

License

ISC

Unpacked Size

43.1 kB

Total Files

18

Last publish

Collaborators

  • nicolasmahe
  • anthony-mesg
  • nicolas-mesg