1.2.4 • Published 2 years ago

@mherod/html-inliner v1.2.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

html-inliner

A simple little tool to inline the stylesheets, scripts and images referenced by link as embedded styles, base64 images and embedded scripts respectively.

This is useful for cases where you want to publish a page via some platform which limits access to external resources.

For example, the following HTML:

<html>
  <head>
    <link rel="stylesheet" href="http://example.com/style.css">
  </head>
  <body>
    <script src="http://example.com/script.js"></script>
  </body>
</html>

Would be transformed into:

<html>
  <head>
    <style type="text/css">
      /* contents of http://example.com/style.css */
    </style>
  </head>
  <body>
    <script>
        /* contents of http://example.com/script.js */
    </script>
  </body>
</html>

Usage

Installation

npm install -g @mherod/html-inliner

or if you prefer Yarn:

yarn global add @mherod/html-inliner

Command line

html-inliner <input-directory> [options]

Options:
  --no-inline-js        Don't inline scripts
  --no-inline-styles    Don't inline stylesheets

Node.js

const htmlInliner = require('@mherod/html-inliner');
htmlInliner.transformAll("./dist/")
1.2.4

2 years ago

1.2.3

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago