gulp-pdflatex
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -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" | ||
} | ||
} |
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
3095
41
3
5
+ Addedraw-body@^2.1.7
+ Addedbytes@3.1.2(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addednode-pdflatex@0.2.0(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedunpipe@1.0.0(transitive)
- Removednode-pdflatex@0.1.1(transitive)
Updatednode-pdflatex@^0.2.0