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

pug-runtime

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-runtime

The runtime components for the pug templating language

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5M
increased by3.53%
Maintainers
2
Weekly downloads
 
Created

What is pug-runtime?

The pug-runtime package is a runtime library for Pug, a high-performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers. It is used to render Pug templates into HTML.

What are pug-runtime's main functionalities?

Rendering Pug Templates

This feature allows you to compile and render Pug templates into HTML. The code sample demonstrates how to compile a simple Pug template and render it with a given context.

const pug = require('pug-runtime');
const template = pug.compile('p Hello, #{name}!');
const html = template({ name: 'World' });
console.log(html); // Outputs: <p>Hello, World!</p>

Precompiled Templates

This feature allows you to use precompiled Pug templates. The code sample shows how to render HTML using a precompiled template function.

const pug = require('pug-runtime');
const precompiledTemplate = function(locals) { return pug.render('p Hello, ' + locals.name + '!'); };
const html = precompiledTemplate({ name: 'World' });
console.log(html); // Outputs: <p>Hello, World!</p>

Other packages similar to pug-runtime

Keywords

FAQs

Package last updated on 28 Feb 2021

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