Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require('isomorphic-fetch');
const qrcode = require('yaqrcode');
const createReport = require('docx-templates').default;
createReport({
template: process.argv[2],
output: process.argv.length > 3 ? process.argv[3] : null,
data: query =>
fetch('http://swapi.apis.guru', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query }),
})
.then(res => res.json())
.then(res => res.data),
additionalJsContext: {