Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Converts HTML to Pug templating language (formerly Jade).
Requires Node.js version 7.6
or higher.
Turns this :unamused:
<!doctype html>
<html lang="en">
<head>
<title>Hello World!</title>
</head>
<body>
<div id="content">
<h1 class="title">Hello World!</h1>
</div>
</body>
</html>
Into this :tada:
doctype html
html(lang='en')
head
title Hello World!
body
#content
h1.title Hello World!
Get it on npm:
npm install -g html2pug
Accept input from a file or stdin and write to stdout:
# choose a file
html2pug < example.html
# use pipe
echo '<h1>foo</h1>' | html2pug -f
Write output to a file:
html2pug < example.html > example.pug
See html2pug --help
for more information.
const html2pug = require('html2pug')
const html = '<header><h1 class="title">Hello World!</h1></header>'
const pug = html2pug(html, { useTabs: true })
Name | Type | Default | Description |
---|---|---|---|
useTabs | Boolean | false | Use tabs instead of spaces |
useCommas | Boolean | true | Use commas to separate node attributes, or a space if false |
isFragment | Boolean | false | Wraps result in enclosing <html> and <body> tags if false |
[3.0.0] - 2019-04-07
tabs
to useTabs
(BREAKING CHANGE)fragment
to isFragment
(BREAKING CHANGE)preserveLineBreaks
default is true
<script>
, <pre>
etc.)useCommas
for attribute separatorFAQs
Converts HTML to Pug
The npm package html2pug receives a total of 1,267 weekly downloads. As such, html2pug popularity was classified as popular.
We found that html2pug demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.