3.3.12 • Published 4 years ago

docx-h4 v3.3.12

Weekly downloads
339
License
MIT
Repository
github
Last release
4 years ago

NPM version Build Status Dependency Status Known Vulnerabilities Chat on Gitter code style: prettier

NPM

docx

Install

$ npm install --save docx

Demo

Press endpoint on the RunKit website:

Run demos locally:

$ npm run demo

This command will run the demo selector app in the demo folder. It will prompt you to select a demo number, which will run a demo from that folder.

Guide

Please refer to the Wiki for details on how to use this library, examples and much more!

Full documentation can be found here: http://dolanmiu.github.io/docx/index.html

Simple Usage

// Used to create docx files
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);

// Or use the express packer to make the file downloadable.
// res is express' Response object
var exporter = new docx.ExpressPacker(doc, res);

exporter.pack("My First Document");
// If you want to export it as a .pdf file instead
exporter.packPdf("My First Document");

// done! A file called 'My First Document.docx'
// will be in your file system if you used LocalPacker
// Or it will start downloading if you are using Express

Examples

Check the Wiki for examples.

Contributing

Read the contribution guidelines here.


Made with 💖

Huge thanks to @felipeochoa for awesome contributions to this project

3.3.12

4 years ago

3.3.11

4 years ago

3.3.10

4 years ago

3.3.9

5 years ago

3.3.8

6 years ago

3.3.7

6 years ago

3.3.6

6 years ago

3.3.5

6 years ago

3.3.4

6 years ago

3.3.3

6 years ago

3.3.2

6 years ago

3.3.1

6 years ago

3.3.0

6 years ago

3.2.11

6 years ago

3.2.10

6 years ago

3.2.9

6 years ago

3.2.8

6 years ago

3.2.7

6 years ago

3.2.6

6 years ago

3.2.5

6 years ago

3.2.4

6 years ago

3.2.3

6 years ago

3.2.2

6 years ago

3.2.1

6 years ago

3.2.0

6 years ago