# office-document-properties-with-custom

> Read document properties from Microsoft Office Open XML documents.

Latest version **0.1.0** (published 2019-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install office-document-properties-with-custom
pnpm add office-document-properties-with-custom
yarn add office-document-properties-with-custom
bun add office-document-properties-with-custom
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-01-14 |
| First published | 2019-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 90.8 KB |
| Known vulnerabilities | 0 (+17 in 2 direct dependencies) |
| Install scripts | no |
| Author | Steven Westmoreland & Jan Pfitzner |
| Maintainers | alfrescian |
| Keywords | parse, document, metadata, properties, microsoft, office, docx, pptx, xlsx, xml |

## Links

- npm: https://www.npmjs.com/package/office-document-properties-with-custom
- Repository: https://github.com/alfrescian/office-document-properties
- Homepage: https://github.com/alfrescian/office-document-properties#readme
- Issues: https://github.com/alfrescian/office-document-properties/issues
- npm.io page: https://npm.io/package/office-document-properties-with-custom

## Dependencies (5)

- [xpath](https://npm.io/package/xpath.md) 0.0.27
- [yauzl](https://npm.io/package/yauzl.md) ^2.8.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.18
- [xmldom](https://npm.io/package/xmldom.md) ^0.1.27

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-01-14
- 0.0.1 — 2019-01-09

## README

<h3 align="center">office-document-properties-with-custom</h3>

<p align="center">Read document properties (incl custom properties) from Microsoft Office Open XML documents.</p>

<p align="center">
  <a href="https://badge.fury.io/js/office-document-properties-with-custom">
    <img src="https://badge.fury.io/js/office-document-properties-with-custom.svg" alt="npm version badge">
  </a>
</p>

## Introduction

Use this node module to read document properties and metadata from Microsoft Office Open XML documents (docx, docm, pptx, pptm, xlsx, xlsm).

## Installation

To install via npm:

```sh
npm install office-document-properties-with-custom --save
```

## Usage

### Import

```js
var documentProperties = require('office-document-properties-with-custom');
```

### Custom MS Office Properties (optional)

```js
var customPropertiesSettings = [{
  "name": "status",
  "msName": "Status",
  "type": "string"
}];

documentPropertiesWorker.provideCustomPropertiesSettings(customPropertiesSettings);
```

### Read Document Properties from File

```js
documentProperties.fromFilePath(filePath, function(err, data) {
  if (err) throw err;
  console.log(data);
  /*
  {
    application: 'Microsoft Macintosh Word',
    applicationVersion: '15.0000',
    characters: 20,
    comments: 'This is an example document for testing the retrieval of document properties.',
    company: 'Acme',
    created: '2017-09-06T17:32:00Z',
    createdBy: 'Microsoft Office User',
    keywords: 'Example Sample Test Properties',
    manager: 'John Doe',
    modified: '2017-10-13T19:26:00Z',
    modifiedBy: 'Microsoft Office User',
    pages: 1,
    paragraphs: 1,
    revision: 5,
    subject: 'Example',
    template: 'Normal.dotm',
    title: 'Test Word Document',
    totalTime: 8,
    words: 5
  }
  */
})
```

### Read Document Properties from Buffer

```js
getDocumentProperties.fromBuffer(buffer, function(err, data) {
  if (err) throw err;
  console.log(data);
  /*
  {
    application: 'Microsoft Macintosh PowerPoint',
    applicationVersion: '15.0027',
    comments: 'This is an example document for testing the retrieval of document properties.',
    company: 'Acme',
    created: '2017-10-13T15:54:58Z',
    createdBy: 'Microsoft Office User',
    keywords: 'Example Sample Test Properties',
    manager: 'Jane Doe',
    modified: '2017-10-13T19:27:15Z',
    modifiedBy: 'Microsoft Office User',
    notes: 0,
    paragraphs: 2,
    revision: 3,
    slides: 1,
    subject: 'Example',
    title: 'Test PowerPoint Document',
    totalTime: 2,
    words: 8
  }
  */
})
```

---
_Source: https://npm.io/package/office-document-properties-with-custom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
