0.1.2 • Published 3 years ago

@graffiticode/graffiticode-compiler-framework v0.1.2

Weekly downloads
16
License
Apache-2.0
Repository
github
Last release
3 years ago

Graffiticode Compiler Framework

An open source framework for writing graffiticode compilers.

The framework allows you to go from:

exports.compiler = {
  language: 'L0',
  async compile(code, data, config) {
      return '<code+data+config>';
  },
};

To:

curl http://my-url
# Output: Hello, L0!

All without needing to worry about writing an HTTP server or complicated request handling logic.

Installation

Add the Graffiticode Compiler Framework to your package.json file using npm.

npm install @graffiticode/graffiticode-compiler-framework

Quickstart

Create an index.js file with the following contents:

exports.compiler = {
  language: 'L0',
  async compile(code, data, config) {
      return '<code+data+config>';
  },
};

Run the following command:

npx @graffiticode/graffiticode-compiler-framework --target=compiler

Configure the Graffiticode Compiler Framework

You can configure the Graffiticode Compiler Framework using command-line flags or environment variables. If you specify both, the environment variable will be ignored.

Command-line flagEnvironment variableDescription
--portPORTThe port on which the Graffiticode Compiler Framework listens for requests. Default: 8080
--targetFUNCTION_TARGETThe name of the exported function to be invoked in response to requests. Default: compiler
--sourceFUNCTION_SOURCEThe path of your project directory where you want to start. Graffiticode Compiler framework always look only at root path, setting this option will look for your function in any other folder. Default: /

You can set command-line flags in your package.json via the start script. For example:

  "scripts": {
    "start": "graffiticode-compiler-framework --target=compiler"
  }

wip Advanced Docs

More advanced guides and docs can be found in the docs/ folder.

Contributing

Contributions to this library are welcome and encouraged. See CONTRIBUTING for more information on how to get started.

NOTE: This is not an officially supported Google product.

0.1.2

3 years ago

0.0.17

3 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.7

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago