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

postxml

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postxml

Xml transformations

latest
Source
npmnpm
Version
0.2.9
Version published
Maintainers
1
Created
Source

Postxml

It is a tool for transforming html/xml with JS plugins based on cheerio.

Instalation

npm i postxml --save-dev

Usage

Nodejs

var postxml = require('postxml');
var cheerioOptions = {};

var output = postxml([
      require('postxml-plugin')(pluginOptions)
   ])
   .process('<div class="b-block"></div>', cheerioOptions);
);

Gulp

Use gulp-postxml

var postxml = require('gulp-postxml');
var postxmlPlugins = [
      require('postxml-plugin')(pluginOptions)
   ];
var cheerioOptions = {};

gulp.task('html', function () {
   gulp.src('index.htm')
      .pipe(postxml(postxmlPlugins, cheerioOptions))
      .pipe(gulp.dest('out'));
})

API

Process(html, cheerioOptions)

Transform html with plugins

Use(plugin)

Add plugin

Boilerplate for new plugins

Plugins

Ideas for plugins

  • postxml-inline-data - replace images and files with data uri
  • postxml-template - added template for postxml-repeat
  • postxml-lazyload - shortcut syntax for lazyload
  • postxml-prefix - add prefix to all classes
  • postxml-size - shortcut width & height
  • postxml-variables - html variables

Examples of usage postxml in real projects

Keywords

html

FAQs

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