diff --git a/README.md b/README.md index 92d494f..9a0c8e5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # NodeEnv -Using this tool you can store your code in a .env file, which you can deploy to repl.it and have your code be hidden! This currently only works with one file. \ No newline at end of file +Using this tool you can store your code in a .env file, which you can deploy to repl.it and have your code be hidden! This currently only works with one file. + +## Notes + +The code is very simple as this is currently just a "proof of concept". + +## Giving this "tool" a try + +Run `tool.js` with the input file as the argument. Example: `node tool.js example.js` The tool should spit out a JSON string. + +Go to Replit "Secrets", open the raw editor and paste it in. + +Now copy the contents from replit.js, create a new file in the Replit, named index.js and paste the contents in. \ No newline at end of file diff --git a/example.js b/example.js new file mode 100644 index 0000000..2b192d8 --- /dev/null +++ b/example.js @@ -0,0 +1,2 @@ +console.log(`It's a beautiful day, the sun is shining!`); +console.log(new Date().toLocaleDateString()); \ No newline at end of file diff --git a/tool.js b/tool.js new file mode 100644 index 0000000..dfc01ef --- /dev/null +++ b/tool.js @@ -0,0 +1,16 @@ +const fs = require(`fs`); +console.log(`Please note that this tool currently only supports one single file. It may be improved in the future.`); + +if (process.argv.length === 3) { + fs.readFile(process.argv[2], (error, data) => { + if (error) console.error(error); + else { + console.log(`Paste the following code into the Raw Secrets Editor:\n`) + console.log(JSON.stringify({ + code: data.toString(`base64`) + })); + } + }) +} else { + console.log(`Usage: `); +} \ No newline at end of file