Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mustache-prestatic

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mustache-prestatic

Compile pages of static HTML based on partials, views and data.

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

{{ mustache }} prestatic

Travis Build Status David Dependencies Status David devDependencies Status

Node.js module that turns mustache files, partials and data into static HTML pages. Making mustache.js usable through a simple CLI and JavaScript API by allowing multiple files as input. mustache-prestatic automatically maps the passed partial files to their file names and populates the template files from passed data files with the same name.

npm install mustache-prestatic --save-dev

Examples

CLI

This will take all files in the 'views', 'data' and 'partials' directories and use those together to write HTML files to the 'dist' directory.:

mustache-prestatic ./views/* --data ./data/* --partials ./partials/* --output dist

JavaScript

const mustachePrestatic = require('mustache-prestatic');

const templateFiles = ['views/blog.mustache', 'views/home.mustache'];
const dataFiles = ['data/home.json'];
const partialFiles = ['partials/article.mustache', 'partials/header.mustache'];

mustachePrestatic(templateFiles, dataFiles, partialFiles)
  .then(console.log);

API

CLI

Usage: mustache-prestatic templateFiles [options]
Compile pages of static HTML from mustache templates, data and partials.

Options:
  --help, -h      Show help text.
  --version, -v   Show version number.
  --data, -d      Input mustache template data files.
  --partials, -p  Input mustache partial files.
  --output, -o    Output directory, defaults to current directory.
  --verbose       Log extra information about the process to stdout.

JavaScript

mustachePrestatic(templateFiles, [dataFiles], [partialFiles])

Compile HTML from provided mustache files.

templateFiles

Type: Array
The files that contain the mustache templates, or often called views.

dataFiles

Type: Array
The files that contain the mustache template data, this data will populate the template files.

partialFiles

Type: Array
The files that contain the mustache partials, these are re-usable parts of views that get included.

Keywords

FAQs

Package last updated on 25 Aug 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc