New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

html-monolith

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

html-monolith

This tool puts all js and css files into html inline.

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

HTML Monolith

This tool puts all JS and CSS files into html inline.

Methods

inline(filePath, options, callback)

  • filePath - full path to file
  • options - for available options see below
  • callback - callback function function(result){}

var result = inlineSync(filePath, options)

  • filePath - full path to file
  • options - for available options see below

Usage

var monolith = require('html-monolith');

var file = '/path/to/file.html';
var options = {
    js: true,
    css: true
};

var result = monolith.inlineSync(file, options);


// console.log(result);
{
    source: '<html>...</html>', // new html with inlined files
    files: [                    // files that were in-lined
      {
        tag: '<script src="scripts/app.js"></script>',  // tag which was replaced with inline content
        src: 'scripts/app.js',                          // relative path to inlined file
        path: '/path/to/scripts/app.js',                // absolute path to inlined file
        type: 'js'                                      // inlined file's type
      },
      {
        tag: '<link href="styles/custom.css" />',
        src: 'styles/custom.css',
        path: '/path/to/styles/custom.css',
        type: 'css'
      }
    ]
}


Tests

To run tests use default npm command npm test

Keywords

html

FAQs

Package last updated on 29 Dec 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