Initial Commit

This commit is contained in:
Julia 2021-10-16 12:56:56 +02:00
parent 6d85610ac7
commit 0e7667b2cf
3 changed files with 31 additions and 1 deletions

View File

@ -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.
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.

2
example.js Normal file
View File

@ -0,0 +1,2 @@
console.log(`It's a beautiful day, the sun is shining!`);
console.log(new Date().toLocaleDateString());

16
tool.js Normal file
View File

@ -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: <infile.js>`);
}