Skip to content

Commit

Permalink
convert to es6 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dougchestnut committed May 8, 2024
1 parent f7f1a10 commit f64527f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/doc-conversion-wrapper/convert.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env node

const mammoth = require('mammoth');
const TurndownService = require('turndown');
const fs = require('fs');
const path = require('path');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const libxmljs = require('libxmljs');
const saxonJs = require('saxon-js');
const sharp = require('sharp');

import mammoth from 'mammoth';
import TurndownService from 'turndown';
import fs from 'fs';
import path from 'path';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import libxmljs from 'libxmljs';
import saxonJs from 'saxon-js';
import sharp from 'sharp';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url)); // Define __dirname for ES Modules
const turndownService = new TurndownService();

const argv = yargs(hideBin(process.argv))
Expand All @@ -24,7 +24,7 @@ const argv = yargs(hideBin(process.argv))
description: 'Overwrite existing markdown files',
})
.argv;

const docPaths = argv._;
const outDir = argv.outdir;
const overwrite = argv.overwrite;
Expand Down Expand Up @@ -172,4 +172,4 @@ docPaths.forEach(docPath => {
} else {
console.error(`Unsupported file extension: ${parsedPath.ext}`);
}
});
});
1 change: 1 addition & 0 deletions packages/doc-conversion-wrapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@uvalib/doc-conversion-wrapper",
"version": "0.0.1",
"type":"module",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f64527f

Please sign in to comment.