Files
docx-js/docs
2018-09-20 14:00:49 -03:00
..
2018-09-20 14:00:49 -03:00
2018-08-05 04:18:12 +01:00
2018-08-09 03:23:07 +01:00
2018-08-22 01:14:17 +01:00
2018-08-04 04:03:08 +01:00
2018-09-11 19:16:47 +01:00

clippy the assistant

Easily generate .docx files with JS/TS. Works for Node and on the Browser. 💯


Welcome

Installation

npm install --save docx

Then you can require or import as usual:

let docx = require("docx");
import * as docx from "docx";

Basic Usage

var docx = require("docx");

// Create document
var doc = new docx.Document();

// Add some content in the document
var paragraph = new docx.Paragraph("Some cool text here.");
// Add more text into the paragraph if you wish
paragraph.addRun(new docx.TextRun("Lorem Ipsum Foo Bar"));
doc.addParagraph(paragraph);

// Used to export the file into a .docx file
var exporter = new docx.LocalPacker(doc);

exporter.pack("My First Document");

// Done! A file called 'My First Document.docx' will be in your file system if you used LocalPacker

Honoured Mentions

@felipeochoa

@h4buli

clippy the assistant


Made with 💖