svelte-parser 0.1.3

Compile Svelte code into HTML, JS for expressrs
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 12.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 270.17 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ContentGamer

Svelte Parser

a Svelte Parser for the expressrs crate.

Svelte Example

@.svelte (AKA the main route /)

<script lang="ts">
	const username: string = "Test";
	console.log(username);
</script>
<title>Custom page title (Fallback will be the file's name)</title>
<p>Hello world!</p>

How can i use this?

First you'll need to install the expressrs crate then in your code type this:


use expressrs::ExpressLib;
use svelte_parser::svelte;

fn main() {
	let express = ExpressLib::new();
	let app = express();

	app.plugins.push(svelte());
	// Serve a directory called 'public' that has .svelte files
	app.serve_directory(
        "public",
        Some(DirectoryOptions {
            plugin: "svelte".to_string(),
        }),
    );
}