From 3a6bc7a240a4200ee8afacfc99c356153a60ee14 Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:06:55 +0200 Subject: [PATCH 1/8] Update README.md Fork info --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 44124e1..1394f62 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +FORKED FROM ** https://github.com/lugenx/keep2log ** + # Keep2Log - Google Keep to Logseq Converter Keep2Log is a CLI tool that converts Google Keep Takeout files to Logseq journal entries, allowing you to migrate your notes from Google Keep to the Logseq note-taking app. From 2bfc46dd826e7171f69dfb91ec8bf324c972b5bd Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:39:38 +0200 Subject: [PATCH 2/8] (1) Split the two original functions in separate functions, rewrite the code (2) Allow for command line arguments (source and destination directory) (3) use readline-sync instead of readline (4) Create separate Logseq pages instead of Journal pages (5) Use page tags and timestamps (6) Some bulletpoint cleanup (author's individual need) (7) Rename page files with slashes in the title --- convertFile.js | 18 ++--- index.js | 190 +++++++++++++++++++++++++++++++------------------ 2 files changed, 129 insertions(+), 79 deletions(-) diff --git a/convertFile.js b/convertFile.js index 92ff615..6fe127a 100644 --- a/convertFile.js +++ b/convertFile.js @@ -14,14 +14,14 @@ const convertFile = (file) => { hours = hours.toString().padStart(2, "0"); minutes = minutes.toString().padStart(2, "0"); - const mdFileName = `${year}_${month}_${day}.md`; - const formatTitle = (title) => { return title ? `**${title.trim()}**` : ""; }; const formatTextAnnoContent = (text, annotations) => { - let formattedText = text?.replaceAll(/\n(.+)/g, "\n\t- $1"); + let formattedText = text?.replaceAll(/\n(.+)/g, "\n- $1") + .replaceAll(/^-\s*•/gm, '\t-') + .replaceAll(/^-\s+-/gm, '\t\t-'); if (!annotations) return formattedText; let formattedAnnotationsStr = ""; @@ -44,7 +44,7 @@ const convertFile = (file) => { const mappedList = list?.map((item) => item.isChecked ? `DONE ${item.text}` : `TODO ${item.text}` ); - return mappedList?.join("\n\t- "); + return mappedList?.join("\n- "); }; const formatAttachments = (attachments) => { @@ -57,8 +57,8 @@ const convertFile = (file) => { }; const formatLabels = (labels) => { - const mappedLabel = labels?.map((label) => `#[[${label.name}]]`); - return mappedLabel?.join(" "); + const mappedLabel = labels?.map((label) => `${label.name}, `); + return mappedLabel; }; const formattedTitle = formatTitle(file.title); @@ -71,12 +71,12 @@ const convertFile = (file) => { const formattedLabels = formatLabels(file.labels); const timestamp = `${hours}:${minutes}`; - const content = `\n- ${formattedTitle} (${timestamp}) ${ - formattedLabels || "" - }\n\t- ${ + const content = `timestamp:: ${day}.${month}.${year} ${timestamp}\ntags:: ${formattedLabels?.join("") ?? ""}from-keep-2023\n- ${ formattedTextAnnoContent || formattedList || "" } \n\t- ${formattedAttachments}`; + const mdFileName = `${file.title.replaceAll('/', '___')}.md`; + return { mdFileName, content }; }; diff --git a/index.js b/index.js index 6bb6930..5d2bf68 100644 --- a/index.js +++ b/index.js @@ -1,93 +1,143 @@ const fs = require("node:fs"); const path = require("node:path"); -const readline = require("node:readline"); +// const readline = require("node:readline"); +const rls = require("readline-sync"); +// import psp from "prompt-sync-plus"; +// const prompt = psp(); const { stdin: input, stdout: output } = require("node:process"); const convertFile = require("./convertFile.js"); const createOrReturnDirectory = require("./createOrReturnDirectory.js"); const copyAssets = require("./copyAssets.js"); -const rl = readline.createInterface({ input, output }); +//const rl = readline.createInterface({ input, output }); const FIRST_QUESTION = - " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m\n\n >"; + " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m\n\n >. CAUTION: If using Google Keep in other languages, make sure to rename the directory inside Takeout to \'Keep\'!"; const SECOND_QUESTION = - " \n\x1b[1m\x1b[33mEnter location of your 'Journals' folder or press 'ENTER' if you want to create new 'journals' folder in current location\x1b[0m \n\x1b[33m e.g. /Users//Documents//\x1b[0m\n\n >"; + " \n\x1b[1m\x1b[33mEnter location of your 'Notes' folder (CAUTION: The directory should exist!) or press 'ENTER' if you want to create new 'notes' folder in current location\x1b[0m \n\x1b[33m e.g. /Users//Documents//\x1b[0m\n\n >"; let sourceDirectory; let destinationDirectory; let jsonFiles; -const runFirstQuestion = () => { - rl.question(FIRST_QUESTION, (firstAnswer) => { - const askedFolderLocation = firstAnswer.trim().replace(/^['"]|['"]$/g, ""); - sourceDirectory = path.normalize(`${askedFolderLocation}/Takeout/Keep/`); - - if ( - !fs.existsSync(sourceDirectory) || - !fs.statSync(sourceDirectory).isDirectory() - ) { - console.log( - "\n\x1b[1m\x1b[31mTakeout folder not found! Please try again!\x1b[0m" - ); - return runFirstQuestion(); - } +function checkSourcePath(srcpath) { + const askedFolderLocation = srcpath.trim().replace(/^['"]|['"]$/g, ""); + sourceDirectory = path.normalize(`${askedFolderLocation}/Takeout/Keep/`); + + if ( + !fs.existsSync(sourceDirectory) || + !fs.statSync(sourceDirectory).isDirectory() + ) { + console.log( + "\n\x1b[1m\x1b[31mTakeout folder not found! Please try again!\x1b[0m" + ); + return 1; + } + else { + return 0; + } +} + +function checkDestPath(destpath) { + const askedDestinationLocation = destpath + .trim() + .replace(/^['"]|['"]$/g, ""); +destinationDirectory = path.normalize(askedDestinationLocation); + +if ( + !fs.existsSync(destinationDirectory) || + !fs.statSync(destinationDirectory).isDirectory() +) { + console.log( + "\n\x1b[1m\x1b[31mDestination location is not valid! Please try again!\x1b[0m" + ); + return 1; + } + else { + return 0; + } +} + +function getKeepData() { + try { + const files = fs.readdirSync(sourceDirectory); + + jsonFiles = files.filter( + (file) => path.extname(file).toLowerCase() === ".json" + ); + } catch (error) { + console.log("Error getting directory info"); + } + +} +function convertData() { + let processedFilesCount = 0; + for (let file of jsonFiles) { try { - const files = fs.readdirSync(sourceDirectory); + const fileContent = fs.readFileSync(`${sourceDirectory}/${file}`); + const jsonData = JSON.parse(fileContent); + if (jsonData.isTrashed) continue; + const { mdFileName, content } = convertFile(jsonData); - jsonFiles = files.filter( - (file) => path.extname(file).toLowerCase() === ".json" + const pathToAppend = createOrReturnDirectory( + `${destinationDirectory}/notes/` ); - runSecondQuestion(); + + fs.appendFileSync(`${pathToAppend}/${mdFileName}`, content); + processedFilesCount++; } catch (error) { - console.log("Error getting directory info"); - } - }); -}; - -const runSecondQuestion = () => { - rl.question(SECOND_QUESTION, (secondAnswer) => { - const askedDestinationLocation = secondAnswer - .trim() - .replace(/^['"]|['"]$/g, ""); - destinationDirectory = path.normalize(askedDestinationLocation); - - if ( - !fs.existsSync(destinationDirectory) || - !fs.statSync(destinationDirectory).isDirectory() - ) { - console.log( - "\n\x1b[1m\x1b[31mDestination location is not valid! Please try again!\x1b[0m" - ); - return runSecondQuestion(); + console.error(error); } + } + console.log( + `\n\x1b[92m All notes processed. Total converted notes: ${processedFilesCount}. \n Please look for newly created 'notes' folder in '${ + destinationDirectory === "." ? __dirname : destinationDirectory + }' directory. \x1b[0m\n` + ); + copyAssets(sourceDirectory, destinationDirectory); +} - let processedFilesCount = 0; - for (let file of jsonFiles) { - try { - const fileContent = fs.readFileSync(`${sourceDirectory}/${file}`); - const jsonData = JSON.parse(fileContent); - if (jsonData.isTrashed) continue; - const { mdFileName, content } = convertFile(jsonData); - - const pathToAppend = createOrReturnDirectory( - `${destinationDirectory}/journals/` - ); - - fs.appendFileSync(`${pathToAppend}/${mdFileName}`, content); - processedFilesCount++; - } catch (error) { - console.error(error); - } - } - console.log( - `\n\x1b[92m All notes processed. Total converted notes: ${processedFilesCount}. \n Please look for newly created 'journals' folder in '${ - destinationDirectory === "." ? __dirname : destinationDirectory - }' directory. \x1b[0m\n` - ); - copyAssets(sourceDirectory, destinationDirectory); - rl.close(); - }); -}; +function main() { + console.log(`Starting! Arguments: ${process.argv[2]}, ${process.argv[3]}`) + if (typeof process.argv[2] !== 'undefined') { + sourceDirectory = process.argv[2]; + } + else { +/* rl.question(FIRST_QUESTION, (firstAnswer) => { + sourceDirectory = firstAnswer; + rl.close(); + }); */ + + sourceDirectory = rls.question(FIRST_QUESTION); + + } + + if (checkSourcePath(sourceDirectory) == 0) { + getKeepData(); + } + else { + return; + } + + if (typeof process.argv[3] !== 'undefined') { + destinationDirectory = process.argv[3]; + } + else { +/* rl.question(SECOND_QUESTION, (secondAnswer) => { + destinationDirectory = secondAnswer; + rl.close(); + }); */ + destinationDirectory = rls.question(SECOND_QUESTION); + } + + if (checkDestPath(destinationDirectory) == 0) { + convertData(); + } + else { + return; + } -runFirstQuestion(); +} + +main(); \ No newline at end of file From 8abf1d1920190a6adfa52c00057cf4cb43e185e6 Mon Sep 17 00:00:00 2001 From: Elgun Asgar Date: Wed, 24 May 2023 16:41:04 -0400 Subject: [PATCH 3/8] convert annotations, skip trahsed notes --- convertFile.js | 29 +++++++++++++++++++++++++---- index.js | 1 + 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/convertFile.js b/convertFile.js index b44a65a..6b95b44 100644 --- a/convertFile.js +++ b/convertFile.js @@ -20,8 +20,24 @@ const convertFile = (file) => { return title ? `**${title.trim()}**` : ""; }; - const formatText = (text) => { - return text?.replaceAll(/\n(.+)/g, "\n\t- $1"); + const formatTextAnnoContent = (text, annotations) => { + let formattedText = text?.replaceAll(/\n(.+)/g, "\n\t- $1"); + if (!annotations) return formattedText; + let formattedAnnotationsStr = ""; + + for (let annotation of annotations) { + let formattedAnnotation = `\n[${annotation.title}](${annotation.url})`; + + if (text && text.includes(annotation.url)) { + formattedText = formattedText.replace( + annotation.url, + formattedAnnotation + ); + } else { + formattedAnnotationsStr += formattedAnnotation; + } + } + return formattedText + " " + formattedAnnotationsStr; }; const formatList = (list) => { @@ -46,7 +62,10 @@ const convertFile = (file) => { }; const formattedTitle = formatTitle(file.title); - const formattedText = formatText(file.textContent); + const formattedTextAnnoContent = formatTextAnnoContent( + file.textContent, + file.annotations + ); const formattedList = formatList(file.listContent); const formattedAttachments = formatAttachments(file.attachments); const formattedLabels = formatLabels(file.labels); @@ -54,7 +73,9 @@ const convertFile = (file) => { const content = `\n- ${formattedTitle} (${timestamp}) ${ formattedLabels || "" - }\n\t- ${formattedText || formattedList || ""} \n\t- ${formattedAttachments}`; + }\n\t- ${ + formattedTextAnnoContent || formattedList || "" + } \n\t- ${formattedAttachments}`; return { mdFileName, content }; }; diff --git a/index.js b/index.js index 06ee1b3..6bb6930 100644 --- a/index.js +++ b/index.js @@ -67,6 +67,7 @@ const runSecondQuestion = () => { try { const fileContent = fs.readFileSync(`${sourceDirectory}/${file}`); const jsonData = JSON.parse(fileContent); + if (jsonData.isTrashed) continue; const { mdFileName, content } = convertFile(jsonData); const pathToAppend = createOrReturnDirectory( From 2d74812b544b3db38b4206cdeb31e4f13ee853e3 Mon Sep 17 00:00:00 2001 From: Elgun Asgar Date: Wed, 24 May 2023 17:15:47 -0400 Subject: [PATCH 4/8] refactor, version update --- convertFile.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/convertFile.js b/convertFile.js index 6b95b44..92ff615 100644 --- a/convertFile.js +++ b/convertFile.js @@ -37,7 +37,7 @@ const convertFile = (file) => { formattedAnnotationsStr += formattedAnnotation; } } - return formattedText + " " + formattedAnnotationsStr; + return `${formattedText} ${formattedAnnotationsStr}`; }; const formatList = (list) => { diff --git a/package.json b/package.json index 5add81f..ad07d40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keep2log", - "version": "1.1.0", + "version": "1.3.1", "bin": { "keep2log": "index.js" }, From a74895610be910f1301f94a1f24d28a24da5a846 Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:39:38 +0200 Subject: [PATCH 5/8] (1) Split the two original functions in separate functions, rewrite the code (2) Allow for command line arguments (source and destination directory) (3) use readline-sync instead of readline (4) Create separate Logseq pages instead of Journal pages (5) Use page tags and timestamps (6) Some bulletpoint cleanup (author's individual need) (7) Rename page files with slashes in the title --- convertFile.js | 18 ++--- index.js | 190 +++++++++++++++++++++++++++++++------------------ 2 files changed, 129 insertions(+), 79 deletions(-) diff --git a/convertFile.js b/convertFile.js index 92ff615..6fe127a 100644 --- a/convertFile.js +++ b/convertFile.js @@ -14,14 +14,14 @@ const convertFile = (file) => { hours = hours.toString().padStart(2, "0"); minutes = minutes.toString().padStart(2, "0"); - const mdFileName = `${year}_${month}_${day}.md`; - const formatTitle = (title) => { return title ? `**${title.trim()}**` : ""; }; const formatTextAnnoContent = (text, annotations) => { - let formattedText = text?.replaceAll(/\n(.+)/g, "\n\t- $1"); + let formattedText = text?.replaceAll(/\n(.+)/g, "\n- $1") + .replaceAll(/^-\s*•/gm, '\t-') + .replaceAll(/^-\s+-/gm, '\t\t-'); if (!annotations) return formattedText; let formattedAnnotationsStr = ""; @@ -44,7 +44,7 @@ const convertFile = (file) => { const mappedList = list?.map((item) => item.isChecked ? `DONE ${item.text}` : `TODO ${item.text}` ); - return mappedList?.join("\n\t- "); + return mappedList?.join("\n- "); }; const formatAttachments = (attachments) => { @@ -57,8 +57,8 @@ const convertFile = (file) => { }; const formatLabels = (labels) => { - const mappedLabel = labels?.map((label) => `#[[${label.name}]]`); - return mappedLabel?.join(" "); + const mappedLabel = labels?.map((label) => `${label.name}, `); + return mappedLabel; }; const formattedTitle = formatTitle(file.title); @@ -71,12 +71,12 @@ const convertFile = (file) => { const formattedLabels = formatLabels(file.labels); const timestamp = `${hours}:${minutes}`; - const content = `\n- ${formattedTitle} (${timestamp}) ${ - formattedLabels || "" - }\n\t- ${ + const content = `timestamp:: ${day}.${month}.${year} ${timestamp}\ntags:: ${formattedLabels?.join("") ?? ""}from-keep-2023\n- ${ formattedTextAnnoContent || formattedList || "" } \n\t- ${formattedAttachments}`; + const mdFileName = `${file.title.replaceAll('/', '___')}.md`; + return { mdFileName, content }; }; diff --git a/index.js b/index.js index 6bb6930..5d2bf68 100644 --- a/index.js +++ b/index.js @@ -1,93 +1,143 @@ const fs = require("node:fs"); const path = require("node:path"); -const readline = require("node:readline"); +// const readline = require("node:readline"); +const rls = require("readline-sync"); +// import psp from "prompt-sync-plus"; +// const prompt = psp(); const { stdin: input, stdout: output } = require("node:process"); const convertFile = require("./convertFile.js"); const createOrReturnDirectory = require("./createOrReturnDirectory.js"); const copyAssets = require("./copyAssets.js"); -const rl = readline.createInterface({ input, output }); +//const rl = readline.createInterface({ input, output }); const FIRST_QUESTION = - " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m\n\n >"; + " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m\n\n >. CAUTION: If using Google Keep in other languages, make sure to rename the directory inside Takeout to \'Keep\'!"; const SECOND_QUESTION = - " \n\x1b[1m\x1b[33mEnter location of your 'Journals' folder or press 'ENTER' if you want to create new 'journals' folder in current location\x1b[0m \n\x1b[33m e.g. /Users//Documents//\x1b[0m\n\n >"; + " \n\x1b[1m\x1b[33mEnter location of your 'Notes' folder (CAUTION: The directory should exist!) or press 'ENTER' if you want to create new 'notes' folder in current location\x1b[0m \n\x1b[33m e.g. /Users//Documents//\x1b[0m\n\n >"; let sourceDirectory; let destinationDirectory; let jsonFiles; -const runFirstQuestion = () => { - rl.question(FIRST_QUESTION, (firstAnswer) => { - const askedFolderLocation = firstAnswer.trim().replace(/^['"]|['"]$/g, ""); - sourceDirectory = path.normalize(`${askedFolderLocation}/Takeout/Keep/`); - - if ( - !fs.existsSync(sourceDirectory) || - !fs.statSync(sourceDirectory).isDirectory() - ) { - console.log( - "\n\x1b[1m\x1b[31mTakeout folder not found! Please try again!\x1b[0m" - ); - return runFirstQuestion(); - } +function checkSourcePath(srcpath) { + const askedFolderLocation = srcpath.trim().replace(/^['"]|['"]$/g, ""); + sourceDirectory = path.normalize(`${askedFolderLocation}/Takeout/Keep/`); + + if ( + !fs.existsSync(sourceDirectory) || + !fs.statSync(sourceDirectory).isDirectory() + ) { + console.log( + "\n\x1b[1m\x1b[31mTakeout folder not found! Please try again!\x1b[0m" + ); + return 1; + } + else { + return 0; + } +} + +function checkDestPath(destpath) { + const askedDestinationLocation = destpath + .trim() + .replace(/^['"]|['"]$/g, ""); +destinationDirectory = path.normalize(askedDestinationLocation); + +if ( + !fs.existsSync(destinationDirectory) || + !fs.statSync(destinationDirectory).isDirectory() +) { + console.log( + "\n\x1b[1m\x1b[31mDestination location is not valid! Please try again!\x1b[0m" + ); + return 1; + } + else { + return 0; + } +} + +function getKeepData() { + try { + const files = fs.readdirSync(sourceDirectory); + + jsonFiles = files.filter( + (file) => path.extname(file).toLowerCase() === ".json" + ); + } catch (error) { + console.log("Error getting directory info"); + } + +} +function convertData() { + let processedFilesCount = 0; + for (let file of jsonFiles) { try { - const files = fs.readdirSync(sourceDirectory); + const fileContent = fs.readFileSync(`${sourceDirectory}/${file}`); + const jsonData = JSON.parse(fileContent); + if (jsonData.isTrashed) continue; + const { mdFileName, content } = convertFile(jsonData); - jsonFiles = files.filter( - (file) => path.extname(file).toLowerCase() === ".json" + const pathToAppend = createOrReturnDirectory( + `${destinationDirectory}/notes/` ); - runSecondQuestion(); + + fs.appendFileSync(`${pathToAppend}/${mdFileName}`, content); + processedFilesCount++; } catch (error) { - console.log("Error getting directory info"); - } - }); -}; - -const runSecondQuestion = () => { - rl.question(SECOND_QUESTION, (secondAnswer) => { - const askedDestinationLocation = secondAnswer - .trim() - .replace(/^['"]|['"]$/g, ""); - destinationDirectory = path.normalize(askedDestinationLocation); - - if ( - !fs.existsSync(destinationDirectory) || - !fs.statSync(destinationDirectory).isDirectory() - ) { - console.log( - "\n\x1b[1m\x1b[31mDestination location is not valid! Please try again!\x1b[0m" - ); - return runSecondQuestion(); + console.error(error); } + } + console.log( + `\n\x1b[92m All notes processed. Total converted notes: ${processedFilesCount}. \n Please look for newly created 'notes' folder in '${ + destinationDirectory === "." ? __dirname : destinationDirectory + }' directory. \x1b[0m\n` + ); + copyAssets(sourceDirectory, destinationDirectory); +} - let processedFilesCount = 0; - for (let file of jsonFiles) { - try { - const fileContent = fs.readFileSync(`${sourceDirectory}/${file}`); - const jsonData = JSON.parse(fileContent); - if (jsonData.isTrashed) continue; - const { mdFileName, content } = convertFile(jsonData); - - const pathToAppend = createOrReturnDirectory( - `${destinationDirectory}/journals/` - ); - - fs.appendFileSync(`${pathToAppend}/${mdFileName}`, content); - processedFilesCount++; - } catch (error) { - console.error(error); - } - } - console.log( - `\n\x1b[92m All notes processed. Total converted notes: ${processedFilesCount}. \n Please look for newly created 'journals' folder in '${ - destinationDirectory === "." ? __dirname : destinationDirectory - }' directory. \x1b[0m\n` - ); - copyAssets(sourceDirectory, destinationDirectory); - rl.close(); - }); -}; +function main() { + console.log(`Starting! Arguments: ${process.argv[2]}, ${process.argv[3]}`) + if (typeof process.argv[2] !== 'undefined') { + sourceDirectory = process.argv[2]; + } + else { +/* rl.question(FIRST_QUESTION, (firstAnswer) => { + sourceDirectory = firstAnswer; + rl.close(); + }); */ + + sourceDirectory = rls.question(FIRST_QUESTION); + + } + + if (checkSourcePath(sourceDirectory) == 0) { + getKeepData(); + } + else { + return; + } + + if (typeof process.argv[3] !== 'undefined') { + destinationDirectory = process.argv[3]; + } + else { +/* rl.question(SECOND_QUESTION, (secondAnswer) => { + destinationDirectory = secondAnswer; + rl.close(); + }); */ + destinationDirectory = rls.question(SECOND_QUESTION); + } + + if (checkDestPath(destinationDirectory) == 0) { + convertData(); + } + else { + return; + } -runFirstQuestion(); +} + +main(); \ No newline at end of file From adb208513772a25a58c31b2c37b1e2679e82ad9c Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:10:48 +0200 Subject: [PATCH 6/8] Adding dependency on readline-sync --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ad07d40..a7ccbe9 100644 --- a/package.json +++ b/package.json @@ -20,5 +20,8 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", - "license": "ISC" + "license": "ISC", + "dependencies": { + "readline-sync": "^1.4.10" + } } From 9437e6f992b7e6cbf58cf8313374525cc7d946a7 Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:27:02 +0200 Subject: [PATCH 7/8] Update README.md Removing a change unneeded for pull req --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 1394f62..44124e1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -FORKED FROM ** https://github.com/lugenx/keep2log ** - # Keep2Log - Google Keep to Logseq Converter Keep2Log is a CLI tool that converts Google Keep Takeout files to Logseq journal entries, allowing you to migrate your notes from Google Keep to the Logseq note-taking app. From 875e19d3415af1235cadf804fded5e91b5009921 Mon Sep 17 00:00:00 2001 From: Openuser87 <78308306+Openuser87@users.noreply.github.com> Date: Sun, 10 Sep 2023 19:38:58 +0200 Subject: [PATCH 8/8] Corrected prompt question --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5d2bf68..8693fd1 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ const copyAssets = require("./copyAssets.js"); //const rl = readline.createInterface({ input, output }); const FIRST_QUESTION = - " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m\n\n >. CAUTION: If using Google Keep in other languages, make sure to rename the directory inside Takeout to \'Keep\'!"; + " \n\x1b[1m\x1b[33mEnter the location of downloaded and unzipped 'Google Keep' Takeout folder?\x1b[0m \n\x1b[33m e.g. /Users//desktop/\x1b[0m CAUTION: If using Google Keep in other languages, make sure to rename the directory inside Takeout to \'Keep\'!\n\n >."; const SECOND_QUESTION = " \n\x1b[1m\x1b[33mEnter location of your 'Notes' folder (CAUTION: The directory should exist!) or press 'ENTER' if you want to create new 'notes' folder in current location\x1b[0m \n\x1b[33m e.g. /Users//Documents//\x1b[0m\n\n >";