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

htmltemplate-parser

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmltemplate-parser

HTML::Template Parser

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
increased by576.07%
Maintainers
1
Weekly downloads
 
Created
Source

HTMLTemplate Parser

TravisCI

HTML::Template-like templating language parser, that can parse a pragmatic subset of HTML/TMPL tag combinations (see #1) and Perl expressions.

Installation

npm install htmltemplate-parser

CLI

$ htmltemplate-parser --help
Usage: htmltemplate-parser [options]

Options:
  --path         file to parse                               [string] [required]
  --pretty       output with colors                                    [boolean]
  --ignore-html  treat HTML tags as text                               [boolean]

JavaScript API

parse(string, options) method

Parse the supplied template string and return the corresponding AST. Available options:

  • ignoreHTMLTags, (default false) – do not attempt to parse HTML tags, treat them as text,
  • reducePositionLookups, (default false) – do not calculate line, column and offset for most nodes, this would speedup parsing of large files.

Example usage

var fs = require('fs');
var inspect = require('util').inspect;

var parser = require('htmltemplate-parser');

var tmpl = fs.readFileSync('./example.inc', 'utf8');
var ast = parser.parse(tmpl);

console.log(inspect(ast, { colors: true, depth: Infinity }));

Keywords

FAQs

Package last updated on 06 Jan 2016

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