createReport is not a function

See original GitHub issue

image

`import createReport from “docx-templates”; import fs from “fs”;

const template = fs.readFileSync(“output.docx”);

const create = async () => { const buffer = await createReport({ template, data: { lol: “John”, surname: “Appleseed”, }, }); fs.writeFileSync(“report.docx”, buffer); }; create().then(() => console.log(“done”));`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
RezaRahmaticommented, Nov 11, 2021

if you have type:module in your package.json use this way

import { createReport } from 'docx-templates';
0reactions
anjanvbcommented, Feb 12, 2022

With 'type': 'module' in package.json, this works-

import pkg from 'docx-templates';
const {createReport} = pkg;
Read more comments on GitHub >

github_iconTop Results From Across the Web

createReport is not a function "docx-templates" lib nodejs
I am trying to use "docx-templates" node library to convert json to word template. I have installed this lib using npm install.
Read more >
Cannot populate docx template in node.js · Issue #122 - GitHub
Note that the createReport function returns a promise. In your example you are writing a promise to a file. It seems this is...
Read more >
create_report: Create report in DataExplorer - Rdrr.io
This function creates a data profiling report. ... Not run: # Create report create_report(iris) create_report(airquality, y = "Ozone") # Load library ...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
docx-templates - npm
The listCommands function lets you list all the commands in a docx template using the same parser as createReport . import { listCommands...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found