New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

parcel-plugin-raw-mst

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parcel-plugin-raw-mst

Import Mustache templates as strings in your JS using Parcel

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

parcel-plugin-raw-mst

Parcel plugin for loading Mustache templates as strings in your JS

Installation

npm i -D parcel-plugin-raw-mst

Usage

Whenever you require files with an .mst extension, they will be parsed as strings. For example:

people.mst

<ul>
  {{#people}}
  <li>{{name}}</li>
  {{/people}}
</ul>

index.js

const Mustache = require("mustache");
const template = require("./people.mst");

const view = { people: [{ name: "Jane" }, { name: "John" }] };

console.log(Mustache.render(template, view));
// <ul>
//   <li>Jane</li>
//   <li>John</li>
// </ul>

Options

To override the default options, create a .rawMst.js file at the root of your project, which exports an object. For example:

module.exports = {
  minify: process.env.NODE_ENV === "production",
};

minify

type: Boolean
default: false

Replaces line-breaks and consecutive spaces with a single space.

Keywords

parcel

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts