gulp-html2txt
Advanced tools
Comparing version 1.1.0 to 1.2.0
12
index.js
'use strict'; | ||
var map = require('map-stream'); | ||
var es = require('event-stream');; | ||
var es = require('event-stream'); | ||
var gutil = require('gulp-util'); | ||
var html2txt = require('html-to-text'); | ||
module.exports = function(wrap) { | ||
wrap = wrap || 130 | ||
module.exports = function(options) { | ||
options = options || {} | ||
return es.map(function (file, cb) { | ||
file.contents = new Buffer( html2txt.fromString( file.contents.toString(), { | ||
wordwrap: wrap | ||
}) ); | ||
file.contents = new Buffer( html2txt.fromString( file.contents.toString(), options) ); | ||
file.path = gutil.replaceExtension(file.path, '.txt'); | ||
@@ -14,0 +12,0 @@ cb(null,file); |
{ | ||
"name": "gulp-html2txt", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "gulp plugin to convert html to text", | ||
@@ -27,9 +27,8 @@ "main": "index.js", | ||
"gulp-util": "*", | ||
"event-stream": "*", | ||
"html-to-text": "*", | ||
"map-stream": "*" | ||
"event-stream": "^3.3.2", | ||
"html-to-text": "*" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
"mocha": "^2.3.4" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# gulp-html2txt [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] | ||
# gulp-html2txt [![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/hemanth/gulp-html2txt.svg?branch=master)](https://travis-ci.org/hemanth/gulp-html2txt) | ||
> Converts HTML to txt using [html-to-text](https://npmjs.org/package/html-to-text) | ||
@@ -19,3 +19,3 @@ | ||
gulp.src('index.html') | ||
.pipe(html2txt(150)) // optional wordwrap value. | ||
.pipe(html2txt(options)) // options as in `html-to-text` | ||
.pipe(gulp.dest('dist')); | ||
@@ -26,6 +26,4 @@ }); | ||
[travis-url]: http://travis-ci.org/hemanth/gulp-html2txt | ||
[travis-image]: https://secure.travis-ci.org/lazd/gulp-html2txt.png?branch=master | ||
[npm-url]: https://npmjs.org/package/gulp-html2txt | ||
[npm-image]: https://badge.fury.io/js/gulp-repl.png | ||
Floating dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
2739
3
7
33
2
28
+ Addedevent-stream@3.3.5(transitive)
- Removedmap-stream@*
- Removedevent-stream@4.0.1(transitive)
- Removedmap-stream@0.1.0(transitive)
Updatedevent-stream@^3.3.2