Skip to content

Instantly share code, notes, and snippets.

View NikhilNanjappa's full-sized avatar

Nikhil Nanjappa NikhilNanjappa

View GitHub Profile
@NikhilNanjappa
NikhilNanjappa / scan-file.js
Last active February 12, 2022 14:38
Clam AV scan-file.js
'use strict';
const NodeClam = require('clamscan');
module.exports = async function scanFile(filePath) {
console.log(`Attempting virus scan for ${filePath}`);
const clamscan = await new NodeClam().init({
remove_infected: true,
debug_mode: false,
const pdfMakePrinter = require('pdfmake/src/printer');
function generatePdf(docDefinition, callback) => {
try {
const fontDescriptors = { ... };
const printer = new pdfMakePrinter(fontDescriptors);
const doc = printer.createPdfKitDocument(docDefinition);
let chunks = [];
const result;
{
"data": [
"Afghanistan",
"Akrotiri",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",