1.0.1 • Published 3 years ago

@michaelray/gulp-jquery v1.0.1

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 @michaelray/console-color。

Installation

npm install @michaelray/gulp-jquery --save-dev

Install dependencies

npm install jquery jsdom @michaelray/console-color --save-dev

Simple Example

const gulp = require('gulp');
const gulpJquery = require('@michaelray/gulp-jquery');

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