Change main index file to only perform export of functions

This commit is contained in:
Rene Saarsoo 2020-10-01 20:32:23 +03:00
parent dd9baffb8d
commit bdba0ecc52
2 changed files with 5 additions and 19 deletions

View File

@ -1,10 +1,7 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require("fs");
const { generateZwo } = require("../dist/generateZwo");
const { parse } = require("../dist/parser");
const { stats } = require("../dist/stats");
const { parseCliOptions } = require("../dist/parseCliOptions");
const { generateZwo, parse, stats, parseCliOptions } = require("../dist/index");
const opts = parseCliOptions();

View File

@ -1,15 +1,4 @@
import * as fs from "fs";
import { generateZwo } from "./generateZwo";
import { parse } from "./parser";
import { stats } from "./stats";
import { parseCliOptions } from "./parseCliOptions";
const opts = parseCliOptions();
const workout = parse(fs.readFileSync(opts.file, "utf8"));
if (opts.stats) {
console.log(stats(workout));
} else {
console.log(generateZwo(workout));
}
export { generateZwo } from "./generateZwo";
export { parse } from "./parser";
export { stats } from "./stats";
export { parseCliOptions } from "./parseCliOptions";