Skip to content

Commit

Permalink
add gitignore , change to js file
Browse files Browse the repository at this point in the history
  • Loading branch information
jucasoliveira committed Jan 5, 2023
1 parent 12773c2 commit c8264a3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port

*.txt
15 changes: 13 additions & 2 deletions bin/terminalGPT → bin/terminalGPT.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,19 @@ commander
// map all choices to text
const getText = request.data.choices.map((choice) => choice.text);

console.log(`${chalk.cyan("GPT-3: ")}${getText} \n`);
prompt();
console.log(`${chalk.cyan("GPT-3: ")}`);
// console log each character of the text with a delay and then call prompt when it finished
let i = 0;
const interval = setInterval(() => {
if (i < getText[0].length) {
process.stdout.write(getText[0][i]);
i++;
} else {
clearInterval(interval);
console.log("\n");
prompt();
}
}, 10);
}
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "terminalgpt",
"version": "1.0.0",
"main": "./bin/terminalGPT.js",
"description": "Get GPT like chatGPT on your terminal",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -16,6 +16,7 @@
"bugs": {
"url": "https://github.com/jucasoliveira/terminalGPT/issues"
},
"bin": "./bin/terminalGPT.js",
"homepage": "https://github.com/jucasoliveira/terminalGPT#readme",
"dependencies": {
"chalk": "^4.1.2",
Expand Down

0 comments on commit c8264a3

Please sign in to comment.