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

inlinecss

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inlinecss

Inlines stylesheets and style tags into html content

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

inlineCSS

A NodeJS package for inlining external stylesheets and embedded style tags into html content.

Install

npm install inlinecss

Usage

var inlineCSS = require('inlinecss');
var html = inlineCSS.inlineHtml('<style>p{height:50px;}</style><p>Text</p>');

Methods

inlineHtml(html[, options], callback)

Inlines raw html content

  • html - Raw html

  • options - See Options below

  • callback - Function

      inlineCSS.inlineHtml(html, function(inlineHtml) {
      	console.log(inlineHtml);
      });
    

Returns inlined html as an argument.

inlineFile(inFile, outFile[, options], callback)

Creates an inlined html file

  • inFile - Location of file to be inlined

  • outFile - Destination of generated file

  • options - See Options below

  • callback - Function

      inlineCSS.inlineFile(inFile, outFile, function() {
      	console.log('success');
      });
    

No return arguments.

Options

options.cssRoot

Define an optional base directory for external stylesheets

Type: String
Default: ''

options.decodeEntities

Decode HTML entities. Eg: & -> &amp;

Type: Boolean
Default: true

options.inlineStyleTags

Inline content in <style> tags found in the HTML document

Type: Boolean
Default: true

options.removeAttributes

Remove class and id attributes
Provide keepattr in the attribute value to prevent an attribute from being removed.

Type: Boolean
Default: true

Dependencies

License

MIT © Rɪpəl Labs

FAQs

Package last updated on 02 Jun 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