Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docxyz-v3

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docxyz-v3

Javascript port of python-docx.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Since v0.2.0 this package is published to npm as docxyz-v3.

docxyz-v3

Javascript port of python-docx.

Installation

npm i docxyz-v3

Usage

Write

let {Document} = require('docxyz-v3');
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-v3');
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-v3'></script>
<script>
    console.log(docxyz-v3);
    var Document = docxyz-v3.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
Open docxViewer

Keywords

FAQs

Package last updated on 21 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc