gulp-markdown
Advanced tools
Comparing version 3.0.0 to 4.0.0
24
index.js
'use strict'; | ||
const {promisify} = require('util'); | ||
const through = require('through2'); | ||
@@ -6,6 +7,8 @@ const marked = require('marked'); | ||
const pMarked = promisify(marked); | ||
module.exports = options => { | ||
return through.obj((file, enc, cb) => { | ||
return through.obj(async (file, encoding, callback) => { | ||
if (file.isNull()) { | ||
cb(null, file); | ||
callback(null, file); | ||
return; | ||
@@ -15,17 +18,14 @@ } | ||
if (file.isStream()) { | ||
cb(new PluginError('gulp-markdown', 'Streaming not supported')); | ||
callback(new PluginError('gulp-markdown', 'Streaming not supported')); | ||
return; | ||
} | ||
marked(file.contents.toString(), options, (err, data) => { | ||
if (err) { | ||
cb(new PluginError('gulp-markdown', err, {fileName: file.path})); | ||
return; | ||
} | ||
try { | ||
const data = await pMarked(file.contents.toString(), options); | ||
file.contents = Buffer.from(data); | ||
file.extname = '.html'; | ||
cb(null, file); | ||
}); | ||
callback(null, file); | ||
} catch (error) { | ||
callback(new PluginError('gulp-markdown', error, {fileName: file.path})); | ||
} | ||
}); | ||
@@ -32,0 +32,0 @@ }; |
{ | ||
"name": "gulp-markdown", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Markdown to HTML", | ||
@@ -13,3 +13,3 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=8" | ||
}, | ||
@@ -33,12 +33,15 @@ "scripts": { | ||
"dependencies": { | ||
"marked": "^0.4.0", | ||
"marked": "^0.6.2", | ||
"plugin-error": "^1.0.1", | ||
"through2": "^2.0.0" | ||
"through2": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"p-event": "^2.1.0", | ||
"ava": "^1.4.1", | ||
"p-event": "^4.1.0", | ||
"vinyl": "^2.1.0", | ||
"xo": "*" | ||
"xo": "^0.24.0" | ||
}, | ||
"peerDependencies": { | ||
"gulp": ">=4" | ||
} | ||
} |
@@ -33,3 +33,3 @@ # gulp-markdown [![Build Status](https://travis-ci.org/sindresorhus/gulp-markdown.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-markdown) | ||
See the `marked` [options](https://marked.js.org/#/USING_ADVANCED.md). | ||
See the `marked` [options](https://marked.js.org/#/USING_ADVANCED.md#options). | ||
@@ -36,0 +36,0 @@ ### markdown.marked |
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
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
3623
27
4
+ Added@gulpjs/messages@1.1.0(transitive)
+ Added@gulpjs/to-absolute-glob@4.0.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedanymatch@3.1.3(transitive)
+ Addedarray-each@1.0.1(transitive)
+ Addedarray-slice@1.1.0(transitive)
+ Addedasync-done@2.0.0(transitive)
+ Addedasync-settle@2.0.0(transitive)
+ Addedbach@2.0.1(transitive)
+ Addedbare-events@2.5.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbl@5.1.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcliui@7.0.4(transitive)
+ Addedclone@2.1.2(transitive)
+ Addedclone-stats@1.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addedcopy-props@4.0.0(transitive)
+ Addeddetect-file@1.0.0(transitive)
+ Addedeach-props@3.0.0(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedexpand-tilde@2.0.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedfast-levenshtein@3.0.0(transitive)
+ Addedfastest-levenshtein@1.0.16(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfindup-sync@5.0.0(transitive)
+ Addedfined@2.0.0(transitive)
+ Addedflagged-respawn@2.0.0(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@1.0.0(transitive)
+ Addedfs-mkdirp-stream@2.0.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedglob-parent@5.1.26.0.2(transitive)
+ Addedglob-stream@8.0.2(transitive)
+ Addedglob-watcher@6.0.0(transitive)
+ Addedglobal-modules@1.0.0(transitive)
+ Addedglobal-prefix@1.0.2(transitive)
+ Addedglogg@2.2.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedgulp@5.0.0(transitive)
+ Addedgulp-cli@3.0.0(transitive)
+ Addedgulplog@2.2.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhomedir-polyfill@1.0.3(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedini@1.3.8(transitive)
+ Addedinterpret@3.1.1(transitive)
+ Addedis-absolute@1.0.0(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-negated-glob@1.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-plain-object@5.0.0(transitive)
+ Addedis-relative@1.0.0(transitive)
+ Addedis-unc-path@1.0.0(transitive)
+ Addedis-valid-glob@1.0.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlast-run@2.0.0(transitive)
+ Addedlead@4.0.0(transitive)
+ Addedliftoff@5.0.0(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmarked@0.6.3(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmute-stdout@2.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addednow-and-later@3.0.0(transitive)
+ Addedobject.defaults@1.1.0(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedparse-filepath@1.0.2(transitive)
+ Addedparse-passwd@1.0.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-root@0.1.1(transitive)
+ Addedpath-root-regex@0.1.2(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-tick@1.0.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedrechoir@0.8.0(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedreplace-ext@2.0.0(transitive)
+ Addedreplace-homedir@2.0.0(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-dir@1.0.1(transitive)
+ Addedresolve-options@2.0.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsemver-greatest-satisfied-range@2.0.0(transitive)
+ Addedsparkles@2.1.0(transitive)
+ Addedstream-composer@1.0.2(transitive)
+ Addedstream-exhaust@1.0.2(transitive)
+ Addedstreamx@2.20.2(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedsver@1.8.4(transitive)
+ Addedteex@1.0.1(transitive)
+ Addedtext-decoder@1.2.1(transitive)
+ Addedthrough2@3.0.2(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedto-through@3.0.0(transitive)
+ Addedunc-path-regex@0.1.2(transitive)
+ Addedundertaker@2.0.0(transitive)
+ Addedundertaker-registry@2.0.0(transitive)
+ Addedv8flags@4.0.1(transitive)
+ Addedvalue-or-function@4.0.0(transitive)
+ Addedvinyl@3.0.0(transitive)
+ Addedvinyl-contents@2.0.0(transitive)
+ Addedvinyl-fs@4.0.0(transitive)
+ Addedvinyl-sourcemap@2.0.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmarked@0.4.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedxtend@4.0.2(transitive)
Updatedmarked@^0.6.2
Updatedthrough2@^3.0.1