gulp-markdown
Advanced tools
Comparing version 1.2.0 to 2.0.0
21
index.js
'use strict'; | ||
var gutil = require('gulp-util'); | ||
var through = require('through2'); | ||
var marked = require('marked'); | ||
const through = require('through2'); | ||
const marked = require('marked'); | ||
const PluginError = require('plugin-error'); | ||
const replaceExt = require('replace-ext'); | ||
module.exports = function (options) { | ||
return through.obj(function (file, enc, cb) { | ||
module.exports = options => { | ||
return through.obj((file, enc, cb) => { | ||
if (file.isNull()) { | ||
@@ -14,14 +15,14 @@ cb(null, file); | ||
if (file.isStream()) { | ||
cb(new gutil.PluginError('gulp-markdown', 'Streaming not supported')); | ||
cb(new PluginError('gulp-markdown', 'Streaming not supported')); | ||
return; | ||
} | ||
marked(file.contents.toString(), options, function (err, data) { | ||
marked(file.contents.toString(), options, (err, data) => { | ||
if (err) { | ||
cb(new gutil.PluginError('gulp-markdown', err, {fileName: file.path})); | ||
cb(new PluginError('gulp-markdown', err, {fileName: file.path})); | ||
return; | ||
} | ||
file.contents = new Buffer(data); | ||
file.path = gutil.replaceExtension(file.path, '.html'); | ||
file.contents = Buffer.from(data); | ||
file.path = replaceExt(file.path, '.html'); | ||
@@ -28,0 +29,0 @@ cb(null, file); |
{ | ||
"name": "gulp-markdown", | ||
"version": "1.2.0", | ||
"description": "Markdown to HTML", | ||
"license": "MIT", | ||
"repository": "sindresorhus/gulp-markdown", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"gulpplugin", | ||
"markdown", | ||
"marked", | ||
"md", | ||
"compile", | ||
"convert", | ||
"markup", | ||
"html" | ||
], | ||
"dependencies": { | ||
"gulp-util": "^3.0.0", | ||
"marked": "^0.3.2", | ||
"through2": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
} | ||
"name": "gulp-markdown", | ||
"version": "2.0.0", | ||
"description": "Markdown to HTML", | ||
"license": "MIT", | ||
"repository": "sindresorhus/gulp-markdown", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"gulpplugin", | ||
"markdown", | ||
"marked", | ||
"md", | ||
"compile", | ||
"convert", | ||
"markup", | ||
"html" | ||
], | ||
"dependencies": { | ||
"marked": "^0.3.9", | ||
"plugin-error": "^0.1.2", | ||
"replace-ext": "^1.0.0", | ||
"through2": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"vinyl": "^2.1.0", | ||
"xo": "*" | ||
} | ||
} |
# gulp-markdown [![Build Status](https://travis-ci.org/sindresorhus/gulp-markdown.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-markdown) | ||
> Markdown to HTML with [marked](https://github.com/chjj/marked) | ||
> Markdown to HTML with [`marked`](https://github.com/chjj/marked) | ||
*Issues with the output should be reported on the marked [issue tracker](https://github.com/chjj/marked/issues).* | ||
*Issues with the output should be reported on the `marked` [issue tracker](https://github.com/chjj/marked/issues).* | ||
@@ -18,10 +18,10 @@ | ||
```js | ||
var gulp = require('gulp'); | ||
var markdown = require('gulp-markdown'); | ||
const gulp = require('gulp'); | ||
const markdown = require('gulp-markdown'); | ||
gulp.task('default', function () { | ||
return gulp.src('intro.md') | ||
gulp.task('default', () => | ||
gulp.src('intro.md') | ||
.pipe(markdown()) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
.pipe(gulp.dest('dist')) | ||
); | ||
``` | ||
@@ -32,5 +32,5 @@ | ||
### markdown(options) | ||
### markdown([options]) | ||
See the marked [options](https://github.com/chjj/marked#options-1). | ||
See the `marked` [options](https://github.com/chjj/marked#options-1). | ||
@@ -44,2 +44,2 @@ ### markdown.marked | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27
4
3
2
+ Addedplugin-error@^0.1.2
+ Addedreplace-ext@^1.0.0
+ Addedansi-cyan@0.1.1(transitive)
+ Addedansi-red@0.1.1(transitive)
+ Addedarr-diff@1.1.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@2.1.0(transitive)
+ Addedarray-slice@0.2.3(transitive)
+ Addedextend-shallow@1.1.4(transitive)
+ Addedkind-of@1.1.0(transitive)
+ Addedplugin-error@0.1.2(transitive)
+ Addedreplace-ext@1.0.1(transitive)
- Removedgulp-util@^3.0.0
- Removedansi-gray@0.1.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedarray-differ@1.0.0(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedbeeper@1.1.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedclone@1.0.4(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removeddateformat@2.2.0(transitive)
- Removedduplexer2@0.0.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfancy-log@1.3.3(transitive)
- Removedglogg@1.0.2(transitive)
- Removedgulp-util@3.0.8(transitive)
- Removedgulplog@1.0.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-gulplog@0.1.0(transitive)
- Removedisarray@0.0.1(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._reescape@3.0.0(transitive)
- Removedlodash._reevaluate@3.0.0(transitive)
- Removedlodash._reinterpolate@3.0.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.escape@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.template@3.6.2(transitive)
- Removedlodash.templatesettings@3.1.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmultipipe@0.1.2(transitive)
- Removedobject-assign@3.0.0(transitive)
- Removedparse-node-version@1.0.1(transitive)
- Removedreadable-stream@1.1.14(transitive)
- Removedreplace-ext@0.0.1(transitive)
- Removedsparkles@1.0.1(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtime-stamp@1.1.0(transitive)
- Removedvinyl@0.5.3(transitive)
Updatedmarked@^0.3.9