@michaelray/gulp-jquery
v1.0.1
Published
Gulp plugin for generic DOM manipulation by jQuery grammar。【在gulp中使用jquery语法处理DOM】
Downloads
4
Maintainers
Readme
[在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'));
});