I am working on a project to manage printers with CUPS command-line, I have multiple "api’s" that make different thinks, for now i just want so see my parsed JSON result in a view, but I’m clueless on how to pass that value trough Express and then render it in a EJS view:
my api:
const spawnSync = require("child_process").spawnSync;
const parseStdout = require('../utils/utils.js');
function lpstat(){
let printerList = spawnSync("lpstat -p", {
timeout: 10000,
encoding: "utf-8",
});
let parsedList = parseStdout(printerList);
let onlyPrinterList = parsedList.filter(function (line) {
return line.match(line.match(/^printer/) || line.match(/^impressora/));
});
let onlyPrinterNames = onlyPrinterList.map(function (printer) {
return printer.match(/(?: \S+)/)[0].trim();
});
process.on('exit', (code) => {
process.kill();
});
//this is what i want to pass to the view
return JSON.stringify(onlyPrinterNames);
}
my app.js
const express = require('express');
const app = express();
app.listen(3000);
app.set('view engine', 'ejs');
app.get('/lpstat',(req,res) => {
//what should i use here?
res.render('lpstat')
});
my lpstat.ejs
<html lang="en">
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>lpstat</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<p>lpstat result:</p>
<%= what should i use here?%>
</body>
</html>
http://kamagraday.com/ sildenafil
http://prescriptionhim.com viagra prescription online
http://cialisbob.com/ side effects of cialis
amoxicillin 500 mg dosage – buy amoxicilin 500 buy amoxicilin 500 mg online
http://wardenafil.com levitra 20 pills
https://levitradd.com/ how long does it take levitra to work
http://himsprescription.com generic viagra buy
http://himscanada.com/ tadalafil cost walgreens
http://ycialisy.com cialis or viagra or levitra
https://prescriptionhim.com/ viagra non prescription
http://gabenhim.com dosage of gabapentin
http://viagraxyu.com sildenafil citrate 100mg
https://iwermectin.com/ stromectol ivermectin
200 mg viagra – generic viagra online canadian generic viagra in us
http://ivermectineffects.com/ buy ivermectin
https://ivermectineffects.com ivermectin lice dose
https://ivermectinovercounter.com/ stromectol
buy cialis now – tadalafil generic cialis 20mg india cialis pharmacy
internet prescriptions city of plano health department
ivermectin for humans over the counter https://ivermectinhome.com
best levitra prices http://levitrair.com vardenafil 20 mg tablets
erectile dysfunction meaning – free ed pills pills erectile dysfunction
glynn county health department hiv treatment drug
ivermectine sans ordonnance https://ivermectinhome.com
stromectol http://stromectolus.com stromectol
the doctors dr who blood pressure finger monitor
ivermectin tablets for humans https://ivermectinhome.com
cheap cialis online pharmacy – procialisp buy generic cialis online from india
https://albuterolotc.com/ albuterol rx
covid and ivermectin – stromectol topical stromectol lotion
high blood pressure during pregnancy doctor lookup
stromectol 3mg tablets https://ivermectinhome.com
mens erection pills – ed treatment pills free ed pills
mens health increased urinating symptoms of heat stress in humans
stromectol https://ivermectinhome.com
javascript-help.li vs medication online order https://pharmvolk.com where to buy prescription drugs online
ivermectin pills for humans http://ivermcov.com/# stromectol
primary care doctor https://ventolinhfaer.com/ common asthma medications
arthritis and rheumatology revesta medication
ivermectin for humans for sale https://ivermectinhome.com
cost of cytotec tablet – cytotec online pharmacy where to buy cytotec in canada
javascript-help.li and ivermektin http://ivermectini.com ivermectin
doxycycline usa pharmacy – doxycycline 40 mg price doxycycline 1mg
what can people do to reduce the cost of their health insurance? http://zithrozpack.com zithromax price
neurontin – neurontin synthroid 137 mcg coupon
javascript-help.li recommended stromectol cost https://ivermectiny.com ivermectin
viagra capsule online – viagra soft tabs uk viagra on sale
physician s stromectol https://iveramectin.com buy ivermectin for humans
health risks of tilapia http://kamagraday.com kamagra 100
cialis online safe – generic tadalafil no prescription
order vardenafil online cheap – vardenafil pills buy vardenafil line
javascript-help.li with ivermectin for humans https://ivermectiny.com stromectol buy online
prednisone 500 mg tablet – prednisone 2.5 mg price prednisone 20mg tablets price
order cheap accutane – accutane 40 order cheap accutane
javascript-help.li recommended ivermectin tablets for humans for sale http://ivermectinhum.com ivermectina como tomar
buying viagra online without prescription http://viagrob.com cheap pill viagra
kroger amoxicillin price – amoxicillin for uti amoxicillin without dr script
cost of medrol – methylprednisolone 16 mg tab cheapest price for lyrica
buy a dissertation – custom term paper buy a custom essay
viagra soft sale – Buy viagra where to buy viagra over the counter uk
ivermectin price comparison – ivermectin over counter stromectol 3 mg price
javascript-help.li with ivermectin tablets http://ivermectiny.com ivermectin for humans
ventolin tablet price – ventolin generic price ventolin cost australia
cheap doxycycline tablets – prednisolox.com prednisolone 5mg coupon
azithromycin 250 mg 6 tablets https://azithrozpack.com zithromax over counter
ivermectin 12 mg – ivermectin cost purchase ivermectin
cheap sildenafil online – buy cheap sildenafil generic sildenafil cost
http://stromectolo.com – ivermectin for cattle
tadalafil price – site purchasing tadalafil online
blood pressure meter http://ivermectini.com – stromectol 6 mg
acquisto vardenafil online – vardenafil coupon dr phil and steve harvey ed pill
what is hydroxychloroquine – plaquenil lupus weight loss prednisone 473
https://stromectolforte.com/# stromectol 6 mg dosage
walmart generic zyrtec – https://allergyd.com
cenforce 100mg – cenforce100usa kamagra 100 gold
xenical 120 mg capsule – alabama medicaid xenical orlistat slimming pills
ivermectin 0.5% brand name – ivermectin usa stromectol usa
buy generic viagra online free shipping – canadian viagra online pharmacy buy viagra canada pharmacy
price cialis – site usa tadalafil
prednisone over the counter canada – 5 mg prednisone daily deltasone price
india ivermectin – stromectol for humans ivermectin virus
ivermectin over the counter uk http://stromectolforte.com/ stromectol ivermectin stromectol over the counter
can you buy viagra online uk – oneviapill viagra in south africa
best cialis – Cialis fast delivery usa generic cialis for women
online casino real money paypal – pala casino online big fish casino online