0.5.9 • Published 10 months ago
docxtest v0.5.9
Since v0.2.0 this package is published to npm as docxyz.
docxyz
Javascript port of python-docx.
Installation
npm i docxyz
Usage
Write
let {Document} = require('docxyz');
let document = new Document();
document.add_heading('Document Title', 0);
let p = document.add_paragraph('A plain paragraph having some ');
p.add_run('bold').bold = true;
p.add_run(' and some ');
p.add_run('italic.').italic = true;
document.add_heading('Heading, level 1', level=1);
document.add_paragraph('Intense quote', style='Intense Quote');
document.save('demo.docx');
Read and write
let {Document} = require('docxyz');
let fileName = './demo.docx';
let document = new Document(fileName);
let text = document.text;
console.log(text);
let p = document.add_paragraph('Another plain paragraph having some ');
p.add_run('bold').bold = true;
p.add_run(' and some ');
p.add_run('italic.').italic = true;
document.add_heading('Heading, level 2', level=2);
text = document.text;
console.log(text);
document.save('read_and_write.docx');
Browser
<script src='http://unpkg.com/docxyz'></script>
<script>
console.log(docxyz);
var Document = docxyz.Document;
console.log(Document);
console.log(Document());
</script>
See examples.
Documentation
Please read python-docx documentation for now.
Demo
docx-slate: A simple slatejs-based docx editor for demonstration of docxjs.
Open demo on github.io
Open demo on codesandbox.io
Open demo on codesandbox.io
0.5.9
10 months ago
0.5.8
11 months ago
0.5.7
11 months ago
0.5.6
11 months ago
0.5.5
11 months ago
0.4.9
12 months ago
0.4.8
12 months ago
0.5.4
11 months ago
0.4.5
12 months ago
0.5.3
12 months ago
0.4.7
12 months ago
0.4.6
12 months ago
0.5.0
12 months ago
0.5.2
12 months ago
0.5.1
12 months ago
0.3.9
1 year ago
0.3.0
1 year ago
0.3.6
1 year ago
0.2.7
1 year ago
0.4.4
1 year ago
0.3.5
1 year ago
0.2.6
1 year ago
0.2.9
1 year ago
0.3.7
1 year ago
0.2.8
1 year ago
0.4.1
1 year ago
0.3.2
1 year ago
0.2.3
1 year ago
0.4.0
1 year ago
0.3.1
1 year ago
0.2.2
1 year ago
0.4.3
1 year ago
0.3.4
1 year ago
0.2.5
1 year ago
0.4.2
1 year ago
0.3.3
1 year ago
0.2.4
1 year ago
0.2.1
2 years ago
0.2.0
2 years ago