Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-markdown

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-markdown - npm Package Compare versions

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc