npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aspose/words

v24.10.6-0

Published

A powerful library for creating and modifying Microsoft Word files, Web, Text and OpenOffice documents.

Downloads

261

Readme

Node.js Document Processing API

Aspose.Words for Node.js is a native library that offers developers a wealth of features to create, edit, and convert Word, PDF, Web documents, without the need for Microsoft Word environment to be installed on the system. This Node.js is a collection of classes and methods that rely on the Document Object Model (DOM), giving developers direct access to a document's inner workings at the element level. Using our product, Node.js developers can efficiently create complex documents and modify their formatting, layout, and content. This Node.js API is a reliable document processing solution for developers seeking a comprehensive instrument to streamline their document editing and document generation tasks; automate document-intensive business processes at scale; reduce manual intervention, errors, and delays. The API is implemented as a native Node.js module, utilizing Node-API, which allows for maximum processing speed when handling large documents.

Supported Formats

Read and Write Formats

  • Microsoft Word®: DOC, DOT, DOCX, DOTX, DOTM, FlatOpc, FlatOpcMacroEnabled, FlatOpcTemplate, FlatOpcTemplateMacroEnabled, RTF, Microsoft Word 2003 WordprocessingML
  • OpenDocument: ODT, OTT
  • Web: HTML, MHTML
  • Markdown: MD
  • Text: TXT
  • eBook: AZW3, EPUB, MOBI, CHM

Read-Only Formats

  • Microsoft Word®: DocPreWord60
  • Other: XML (XML Document)

Write-Only Formats

  • Fixed Layout: PDF, XPS, OpenXps
  • PostScript: PS, EPS
  • Printer: PCL
  • Markup: XamlFixed, HtmlFixed, XamlFlow, XamlFlowPack
  • Image: SVG, TIFF, PNG, BMP, JPEG, GIF, WEBP
  • Metafile: EMF
  • Other: XLSX

Functionality

  • Provides comprehensive document import and export with 35+ supported file formats. This allows developers to convert documents from one file format to another. For example, you can convert HTML to Word and Word to PDF documents with professional quality.
  • Provides full access to all Word and OpenOffice document elements, including formatting properties and styling.
  • Provides high-fidelity rendering of Word documents to PDF, JPG, PNG and other imaging formats.
  • Provides the ability to print OpenOffice and Word documents programmatically.
  • Provides a rich set of utility functions, you can use to split a document into parts, join documents together, compare documents, and much more.
  • To become familiar with the most popular Aspose.Words functionality, please have a look at our free online applications.

Getting Started with Aspose.Words for Node.js

Simply execute npm install @aspose/words to get the latest version & try any of the following code snippets.

Create a DOCX using Node.js

Aspose.Words for Node.js allows you to create a blank Word document and add content to the file.

const aw = require('@aspose/words');

// Create a Word document.
var doc = new aw.Document();

// Use a DocumentBuilder instance to add content to the file.
var builder = new aw.DocumentBuilder(doc);

// Write a new paragraph to the document.
builder.writeln('This is an example of a Word document created in Node.js');

// Save it as a DOCX file. The output format is automatically determined by the filename extension.
doc.save('OutputWordDocument.docx');

Convert a Word document to HTML with Node.js

You can convert Microsoft Word to PDF, XPS, Markdown, HTML, JPEG, TIFF, and other file formats. The following snippet demonstrates the conversion from DOCX to HTML:

const aw = require('@aspose/words');

// Load a Word file from the local drive.
var doc = new aw.Document('InputWordDocument.docx');

// Save it to HTML format.
doc.save('OutputHtmlDocument.html');

Licensing

Evaluate Aspose.Words

You can use Aspose.Words for Node.js free of cost for evaluation. The evaluation version provides almost all functionality of the product with certain limitations. The same evaluation version becomes licensed when you purchase a license and add a couple of lines of code to apply the license.

If you want to test Aspose.Words for Node.js without evaluation version limitations, you can also request a 30 Day Temporary License. Please refer to How to get a Temporary License?

Evaluation Version Limitations

Evaluation version of Aspose.Words for Node.js without the specified license provides full product functionality, but inserts an evaluative watermark at the top of the document upon loading and saving and limits the maximum document size to a few hundred paragraphs.

About the License

The license is a plain text XML file that contains details such as the product name, number of developers it is licensed to, subscription expiry date and so on. The file is digitally signed, so don’t modify the file. Even inadvertent addition of an extra line break into the file will invalidate it.

You need to set a license before utilizing Aspose.Words for Node.js if you want to avoid its evaluation limitations. It is only required to set a license once per application (or process).

Apply License

The easiest way to set a license, is to put the license file to the application folder and specify the file name without its path.

// Instantiate an instance of License calss and set the license file through its path
const aw = require('@aspose/words');
const license = new aw.License();
license.setLicense("Aspose.Words.lic");

However, if the license is obtained from an external source (e.g., a database), you can use a Buffer:

const aw = require('@aspose/words');
const fs = require('fs');

// For testing purposes, let's simply read the license data from a file.
const data = fs.readFileSync('Aspose.Words.lic');

const license = new aw.License();
license.setLicense(data);

Supported Platforms

The first release only supports Microsoft Windows® x64 platform and Node.js 14.17.0 or higher.