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

brfs-htmlmin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brfs-htmlmin

browserify fs.readFileSync() static html file inliner with html minifier

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

brfs-htmlmin

brfs-htmlmin is kind of a fork of brfs. It's a transform for browserify that allows you to use fs.readFileSync() in your code and will statically inline the content in your bundle.

The difference is that with brfs-htmlmin, it will minify the html output.

install

  • Install brfs-htmlmin in your project: npm install brfs-htmlmin
  • Use it as a transform, in the command line or with the API:
$ browserify -t brfs-htmlmin example/main.js > bundle.js
var browserify = require('browserify');
var fs = require('fs');

var b = browserify('example/main.js');
b.transform('brfs-htmlmin');

b.bundle().pipe(fs.createWriteStream('bundle.js'));

example

for a main.js:

var fs = require('fs');
var html = fs.readFileSync(__dirname + '/doc.html', 'utf8');
console.log(html);

and a doc.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>A RMScreenprint</title>
</head>
<body>
  <h1>Main heading in my document</h1>
  <!-- Note that it is "h" + "1", not "h" + the letters "one" -->
  <p>Look Ma, I am coding <abbr title="Hyper Text Markup Language">HTML</abbr>.</p>
</body>
</html>

options

minify

Type: Object

Hash of options sent to the html-minifier. See github html-minifier by Kangax.

By defaults, these options are already true:

removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true

Keywords

FAQs

Package last updated on 22 Jul 2015

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