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

gulp-pdflatex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-pdflatex - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

2

lib/index.d.ts

@@ -5,3 +5,3 @@ /// <reference types="node" />

texInputs?: string[];
}) => NodeJS.ReadableStream;
}) => NodeJS.ReadWriteStream;
export = gulpPdflatex;
"use strict";
var path_1 = require("path");
var through = require("through2");
var node_pdflatex_1 = require("node-pdflatex");
var replaceExtension = function (path, ext) {
return typeof path === 'string' ?
path_1.join(path_1.dirname(path), path_1.basename(path, path_1.extname(path)) + ext) : path;
};
var gulpPdflatex = function (options) {
return through.obj(function (file, encoding, next) {
if (file.isStream()) {
file.extname = '.pdf';
file.path = replaceExtension(file.path, file.extname);
file.contents = node_pdflatex_1.default(file.contents, {
shellEscape: options.shellEscape,
texInputs: [file.base].concat(options.texInputs),
});
}
const path_1 = require("path");
const through = require("through2");
const getRawBody = require("raw-body");
const node_pdflatex_1 = require("node-pdflatex");
const replaceExtension = (path, ext) => typeof path === 'string' ?
path_1.join(path_1.dirname(path), path_1.basename(path, path_1.extname(path)) + ext) : path;
const gulpPdflatex = (options) => through.obj((file, encoding, next) => {
if (file.isStream()) {
file.extname = '.pdf';
file.path = replaceExtension(file.path, file.extname);
const output = node_pdflatex_1.default(file.contents, {
shellEscape: options.shellEscape,
texInputs: [file.base, ...options.texInputs],
});
file.contents = output;
next(null, file);
});
};
}
else if (file.isBuffer()) {
file.extname = '.pdf';
file.path = replaceExtension(file.path, file.extname);
const input = through();
input.end(file.contents);
const output = node_pdflatex_1.default(input, {
shellEscape: options.shellEscape,
texInputs: [file.base, ...options.texInputs],
});
getRawBody(output)
.then(data => (file.contents = data) && next(null, file))
.catch(err => next(err));
}
else
next(null, file);
});
module.exports = gulpPdflatex;
//# sourceMappingURL=index.js.map
{
"name": "gulp-pdflatex",
"description": "Gulp plugin for LaTeX PDF",
"version": "0.1.3",
"version": "0.2.0",
"main": "lib/index.js",

@@ -21,2 +21,3 @@ "types": "lib/index.d.ts",

"@types/node": "6.0.51",
"@types/raw-body": "^2.1.0",
"@types/through2": "^2.0.32",

@@ -27,5 +28,6 @@ "@types/vinyl": "^2.0.0",

"dependencies": {
"node-pdflatex": "^0.1.1",
"node-pdflatex": "^0.2.0",
"raw-body": "^2.1.7",
"through2": "^2.0.3"
}
}
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