Read document properties from Microsoft Office Open XML documents.
Switch branches/tags
Nothing to show
Clone or download
Latest commit db9ae1d Jul 1, 2018
Permalink
Failed to load latest commit information.
test Adding tests Oct 13, 2017
.gitignore Adding .gitignore Aug 17, 2017
LICENSE Create LICENSE Aug 17, 2017
README.md Updated README and homepage Jun 30, 2018
app.xml.json Updated formatting Oct 13, 2017
core.xml.json Updated formatting Oct 13, 2017
index.js Updated error callbacks Oct 13, 2017
package-lock.json 1.0.7 Jun 30, 2018
package.json 1.0.7 Jun 30, 2018

README.md

office-document-properties

Read document properties from Microsoft Office Open XML documents.

npm version badge

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:

npm install office-document-properties --save

Usage

Import

var getDocumentProperties = require('office-document-properties');

Read Document Properties from File

getDocumentProperties.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

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
  }
  */
})