UNPKG

lx-scan

Version:

License eXtension to find 5-tuples of all installed packages: name, version, project home page, license (e. g. Apache v2, BSD) and required notice. It includes a GUI to edit information for each package and to enter information if necessary.

25 lines (19 loc) 660 B
var lxu = require("lxutils"); var _ = require("underscore"); module.exports.get = function(req,res) { var pathToJSON,pathindex,savepath,err; pathindex = req.query.jfile||1; pathToJSON = req.app.locals.jfiles[pathindex]; savepath = req.query.path; err = req.query.err||0; if(pathToJSON === "") var render_function = _.bind(function(opts) { res.render("index",opts);},this); else var render_function = _.bind(function(opts) { lxu.jRender(pathToJSON,"index",opts,res);},this); var opts = {title:'LX Viewer',jfile:pathindex,caller:"/",path:savepath}; if(err) { opts.err = []; opts.err.push(err); } render_function(opts); };