memory system help needed
Details
ive been trying to make a memory system for a login thing on the console but cant get it right ive been trying to have files be written on but dont no how then ill need to figure out how it will read it and get the data back
Node.js version
Not applicable.
Example code
var fs = require('fs');
var startsword = {dam:dam + 3,defense:5}
var kn = {hp:150,dam:20,speed:15,mag:3,defense:12,wepon1:startsword,wepon2:"none",items:items,};
var user = prompt("username: ")
var pas = prompt("pasword: ")
var items = "noune"
var login = prompt("chose one: ")
var pickcl = "knight mage archer assian thief chose one"
var pcl = prompt("")
console.log("if you have a acount type login if you dont type reg ")
login
if (login == "reg") {
console.log("tpye username);
user
console.log("type pasword");
pas
console.log("chouse a class")
console.log(pickcl)
pcl
fs.appendFile( user +'.txt'," players name: " + user + " pasword: " + pas + " class: " + pcl +, function (err) {
if (err) throw err;
console.log('Saved!');
});
}
Operating system
i dont no what this mean
Scope
?
Module and version
Not applicable.
Console is great for troubleshooting code problems, but what you need is shell interaction. I recommend making use of STDIN and STDOUT with Node's readline library https://nodejs.org/dist/latest-v18.x/docs/api/readline.html
The readline library allows for an interactive experience between the application and the shell its running in.
@zarooma checkout commanderJs it will give you what your looking for and well documented
There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.