From 89b12cdd96f3cdd235bf62335ef579add0958766 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Fri, 7 Mar 2025 10:52:21 -0500 Subject: [PATCH] Rename index to app, update deps, tweak config --- index.js => app.js | 2 +- package-lock.json | 14 +++++++------- package.json | 13 +++++-------- src/questions.js | 8 ++++---- src/writer.js | 6 +++--- 5 files changed, 20 insertions(+), 23 deletions(-) rename index.js => app.js (96%) diff --git a/index.js b/app.js similarity index 96% rename from index.js rename to app.js index 90a183a..806bc53 100644 --- a/index.js +++ b/app.js @@ -11,7 +11,7 @@ import * as writer from './src/writer.js'; (async () => { // configure command line help output commander.program - .name('node index.js') + .name('npx wordpress-export-to-markdown') .helpOption('-h, --help', 'See the thing you\'re looking at right now') .addHelpText('after', '\nMore documentation is at https://github.com/lonekorean/wordpress-export-to-markdown') .configureHelp({ diff --git a/package-lock.json b/package-lock.json index 37245a8..70cf942 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,16 +10,16 @@ "license": "MIT", "dependencies": { "@guyplusplus/turndown-plugin-gfm": "^1.0.7", - "@inquirer/prompts": "^7.2.3", - "axios": "^1.7.9", + "@inquirer/prompts": "^7.3.2", + "axios": "^1.8.2", "chalk": "^5.4.1", - "commander": "^13.0.0", + "commander": "^13.1.0", "luxon": "^3.5.0", "turndown": "^7.2.0", "xml2js": "^0.6.2" }, "bin": { - "wordpress-export-to-markdown": "index.js" + "wordpress-export-to-markdown": "app.js" }, "engines": { "node": ">= 18.0.0" @@ -370,9 +370,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", - "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz", + "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/package.json b/package.json index 38a0f96..b5e2ad4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wordpress-export-to-markdown", "version": "2.4.2", "description": "Converts a WordPress export XML file into Markdown files.", - "main": "index.js", + "main": "app.js", "repository": "https://github.com/lonekorean/wordpress-export-to-markdown.git", "keywords": [ "blog", @@ -11,9 +11,6 @@ "markdown", "wordpress" ], - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "author": "Will Boyd (https://codersblock.com)", "license": "MIT", "engines": { @@ -22,15 +19,15 @@ "type": "module", "dependencies": { "@guyplusplus/turndown-plugin-gfm": "^1.0.7", - "@inquirer/prompts": "^7.2.3", - "axios": "^1.7.9", + "@inquirer/prompts": "^7.3.2", + "axios": "^1.8.2", "chalk": "^5.4.1", - "commander": "^13.0.0", + "commander": "^13.1.0", "luxon": "^3.5.0", "turndown": "^7.2.0", "xml2js": "^0.6.2" }, "bin": { - "wordpress-export-to-markdown": "./index.js" + "wordpress-export-to-markdown": "./app.js" } } diff --git a/src/questions.js b/src/questions.js index f580293..0e9a18b 100644 --- a/src/questions.js +++ b/src/questions.js @@ -56,7 +56,7 @@ export function load() { { name: 'date-folders', type: 'choice', - description: 'Organize posts into folders by date', + description: 'Organize posts into date folders', default: 'none', choices: [ { @@ -113,13 +113,13 @@ export function load() { default: 'title,date,categories,tags,coverImage,draft' }, { - name: 'image-file-request-delay', + name: 'request-delay', type: 'integer', description: 'Delay between image file requests', default: 500 }, { - name: 'markdown-file-write-delay', + name: 'write-delay', type: 'integer', description: 'Delay between writing markdown files', default: 10 @@ -131,7 +131,7 @@ export function load() { default: 'utc' }, { - name: 'include-time-with-date', + name: 'include-time', type: 'boolean', description: 'Include time with frontmatter date', default: false diff --git a/src/writer.js b/src/writer.js index c2ba37e..5a6b4cc 100644 --- a/src/writer.js +++ b/src/writer.js @@ -59,7 +59,7 @@ async function writeMarkdownFilesPromise(posts) { destinationPath, delay }; - delay += shared.config.markdownFileWriteDelay; + delay += shared.config.writeDelay; return [payload]; } }); @@ -90,7 +90,7 @@ async function loadMarkdownFilePromise(post) { if (shared.config.dateFormat) { outputValue = value.toFormat(shared.config.dateFormat); } else { - outputValue = shared.config.includeTimeWithDate ? value.toISO() : value.toISODate(); + outputValue = shared.config.includeTime ? value.toISO() : value.toISODate(); } if (shared.config.quoteDate) { @@ -138,7 +138,7 @@ async function writeImageFilesPromise(posts) { destinationPath, delay }; - delay += shared.config.imageFileRequestDelay; + delay += shared.config.requestDelay; return [payload]; } });