Rename index to app, update deps, tweak config

This commit is contained in:
Will Boyd
2025-03-07 10:52:21 -05:00
parent 6562b60b5c
commit 89b12cdd96
5 changed files with 20 additions and 23 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import * as writer from './src/writer.js';
(async () => { (async () => {
// configure command line help output // configure command line help output
commander.program commander.program
.name('node index.js') .name('npx wordpress-export-to-markdown')
.helpOption('-h, --help', 'See the thing you\'re looking at right now') .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') .addHelpText('after', '\nMore documentation is at https://github.com/lonekorean/wordpress-export-to-markdown')
.configureHelp({ .configureHelp({
+7 -7
View File
@@ -10,16 +10,16 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@guyplusplus/turndown-plugin-gfm": "^1.0.7", "@guyplusplus/turndown-plugin-gfm": "^1.0.7",
"@inquirer/prompts": "^7.2.3", "@inquirer/prompts": "^7.3.2",
"axios": "^1.7.9", "axios": "^1.8.2",
"chalk": "^5.4.1", "chalk": "^5.4.1",
"commander": "^13.0.0", "commander": "^13.1.0",
"luxon": "^3.5.0", "luxon": "^3.5.0",
"turndown": "^7.2.0", "turndown": "^7.2.0",
"xml2js": "^0.6.2" "xml2js": "^0.6.2"
}, },
"bin": { "bin": {
"wordpress-export-to-markdown": "index.js" "wordpress-export-to-markdown": "app.js"
}, },
"engines": { "engines": {
"node": ">= 18.0.0" "node": ">= 18.0.0"
@@ -370,9 +370,9 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.8.1", "version": "1.8.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz",
"integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",
+5 -8
View File
@@ -2,7 +2,7 @@
"name": "wordpress-export-to-markdown", "name": "wordpress-export-to-markdown",
"version": "2.4.2", "version": "2.4.2",
"description": "Converts a WordPress export XML file into Markdown files.", "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", "repository": "https://github.com/lonekorean/wordpress-export-to-markdown.git",
"keywords": [ "keywords": [
"blog", "blog",
@@ -11,9 +11,6 @@
"markdown", "markdown",
"wordpress" "wordpress"
], ],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Will Boyd <will@codersblock.com> (https://codersblock.com)", "author": "Will Boyd <will@codersblock.com> (https://codersblock.com)",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -22,15 +19,15 @@
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@guyplusplus/turndown-plugin-gfm": "^1.0.7", "@guyplusplus/turndown-plugin-gfm": "^1.0.7",
"@inquirer/prompts": "^7.2.3", "@inquirer/prompts": "^7.3.2",
"axios": "^1.7.9", "axios": "^1.8.2",
"chalk": "^5.4.1", "chalk": "^5.4.1",
"commander": "^13.0.0", "commander": "^13.1.0",
"luxon": "^3.5.0", "luxon": "^3.5.0",
"turndown": "^7.2.0", "turndown": "^7.2.0",
"xml2js": "^0.6.2" "xml2js": "^0.6.2"
}, },
"bin": { "bin": {
"wordpress-export-to-markdown": "./index.js" "wordpress-export-to-markdown": "./app.js"
} }
} }
+4 -4
View File
@@ -56,7 +56,7 @@ export function load() {
{ {
name: 'date-folders', name: 'date-folders',
type: 'choice', type: 'choice',
description: 'Organize posts into folders by date', description: 'Organize posts into date folders',
default: 'none', default: 'none',
choices: [ choices: [
{ {
@@ -113,13 +113,13 @@ export function load() {
default: 'title,date,categories,tags,coverImage,draft' default: 'title,date,categories,tags,coverImage,draft'
}, },
{ {
name: 'image-file-request-delay', name: 'request-delay',
type: 'integer', type: 'integer',
description: 'Delay between image file requests', description: 'Delay between image file requests',
default: 500 default: 500
}, },
{ {
name: 'markdown-file-write-delay', name: 'write-delay',
type: 'integer', type: 'integer',
description: 'Delay between writing markdown files', description: 'Delay between writing markdown files',
default: 10 default: 10
@@ -131,7 +131,7 @@ export function load() {
default: 'utc' default: 'utc'
}, },
{ {
name: 'include-time-with-date', name: 'include-time',
type: 'boolean', type: 'boolean',
description: 'Include time with frontmatter date', description: 'Include time with frontmatter date',
default: false default: false
+3 -3
View File
@@ -59,7 +59,7 @@ async function writeMarkdownFilesPromise(posts) {
destinationPath, destinationPath,
delay delay
}; };
delay += shared.config.markdownFileWriteDelay; delay += shared.config.writeDelay;
return [payload]; return [payload];
} }
}); });
@@ -90,7 +90,7 @@ async function loadMarkdownFilePromise(post) {
if (shared.config.dateFormat) { if (shared.config.dateFormat) {
outputValue = value.toFormat(shared.config.dateFormat); outputValue = value.toFormat(shared.config.dateFormat);
} else { } else {
outputValue = shared.config.includeTimeWithDate ? value.toISO() : value.toISODate(); outputValue = shared.config.includeTime ? value.toISO() : value.toISODate();
} }
if (shared.config.quoteDate) { if (shared.config.quoteDate) {
@@ -138,7 +138,7 @@ async function writeImageFilesPromise(posts) {
destinationPath, destinationPath,
delay delay
}; };
delay += shared.config.imageFileRequestDelay; delay += shared.config.requestDelay;
return [payload]; return [payload];
} }
}); });