<repo_name>xplorebits/xploreoffice<file_sep>/README.md
# XploreOffice: Office Open XML Documents to HTML Converter.
xploreoffice is designed to parse Office Open XML standard documents into HTML documents.

> Under development

## Overview
The aim of this project is to convert Open Office XML (<b>.docx</b>, <b>.pptx</b> and <b>.xlsx</b>) documents into HTML documents.

## Test
1. git clone `https://github.com/xplorebits/xploreoffice.git`
2. Go to xploreoffce/ and do `npm install`
3. run `npm test`

## Progress
- [ ] <b>.docx</b> Documents
  - [x] Text only documents
  - [ ] List item support
  - [ ] Table support
  - [ ] Image support
  - [ ] Page frame support
- [ ] <b>.pptx</b> Documents
- [ ] <b>.xlsx</b> Documents

## Contact
<EMAIL>
<file_sep>/index.js
/**
 * Copyright (c) 2018, XploreBits, (OPC) Pvt Ltd.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

'use strict';

const Word = require('./lib/Word');

function XploreOffice() {
  if (!(this instanceof XploreOffice)) {
    return new XploreOffice();
  }
}

XploreOffice.prototype.Word = function (_srcFilePath) {
  return new Word(_srcFilePath);
}

module.exports = XploreOffice;<file_sep>/test/test.js
const assert = require('assert');

const fs = require('fs');
const os = require('os');
const fops = require('fs-extra');
const path = require('path');
const XploreOffice = require('../index');

describe('Array', function() {
  describe('#indexOf()', function() {
    it('should convert .docx TEXT ONLY document into HTML at ~/Desktop/xploreoffice-output/out.html', function() {
      const office = new XploreOffice();
      const word = office.Word(path.join(
        process.cwd(),
        'test',
        'test.docx'
      ));
      word.createHtml((err, html) => {
        if (err) {
          throw err;
        } else {
          const outPath = path.join(
            os.homedir(),
            'Desktop',
            'xploreoffice-output'
          );
          fops.ensureDirSync(outPath);
          fs.writeFile(
            path.join(
              outPath,
              'out.html'
            ),
            html,
            (err) => {
              if (err) {
                assert.fail(err);
              }
            }
          );
        }
      });
    });
  });
});