Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @marko/compile with all npm packages installed. Try it out:

var compile = require("@marko/compile")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@marko/compile v4.1.2

Compile Marko files


@marko/compile
API Stability NPM Version Downloads

Utility to compile Marko templates to JavaScript.

CLI

Getting Started

npm install @marko/compile
marko-compile template.marko

or

npx @marko/compile template.marko

Example

marko-compile --server ./components/my-component.marko
marko-compile --browser ./components/my-component.marko

Options

  • --server: Compiles a Marko file to render html.
  • --browser: Compiles a Marko file to render vdom.
  • --files --file -f *: Provide a pattern to match marko file(s).
  • --ignore: Provide a pattern to exclude files from being compiled.
  • --clean: Deletes any compiled .marko.js files.

API

Installation

npm install @marko/compile

Example

import compile from "@marko/compile";

compile({
  files: "./components/**/*.marko"
}).then(() => {
  // All files are written to disk.
  console.log("Compiled all files");
});

Options

Options are the same as the CLI options.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free