1.0.2 • Published 3 years ago

gulp-jquery-mr v1.0.2

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

在gulp中使用jquery语法处理DOM

Gulp plugin for generic DOM manipulation by jQuery grammar.

This Gulp plugin is a simple wrapper around JSDom and jQuery making it possible to run DOM operations on any inbound HTML by jQuery grammar.

This Gulp plugin depend on jquery, JSDom and console-color-mr。

Installation

npm install gulp-jquery-mr --save-dev

Install dependencies

npm install jquery jsdom console-color-mr --save-dev

Simple Example

const gulp = require('gulp');
const gulpJquery = require('gulp-jquery-mr');

gulp.task('handleHtml', function () {
	return gulp.src('test/index.html')
		.pipe(gulpJquery(function ($) {
			$('#test').html('Hello Michael Ray');
		}))
		.pipe(gulp.dest('test/build'));
});