This is a Easy-to-use Node.js superset (hence the name, "EnScript") that I made for Node beginners, and people that want a different type of Node.js. You can use normal Node with it aswell.
Note: This is for the v2.0 update. If you want this feature ASAP, then get the release
Comparison between the two:
File Extension | Pros | Cons |
---|---|---|
.en |
- More like a seperate language than a superset | May be confusing at first Does not have backwards compatibility with v1.1 |
.en.native |
- More like a superset - Has better JavaScript support - Most syntax is removed so you can use plain JavaScript along with EnScript |
Does not have backwards compatibility with v1.1 |
- Download the runCode.js
- Make a
script.en
file that looks something like this:console.log['Hello World!'];
3. Go to the path of both files and run this code in the terminal
node runCode.js [name-Of-En-File]
Here is an example of console logging (the famous "Hello World!" one)
console.log['Hello World!'];
Here is another example, with functions.
function test() ~>
console.log['Wowie!'];
<~
test();
Now, see how some lines have the character ;
? It helps the interpreter know it's the end of a line (so there are no errors).
Let's do one more example. A Discord bot!
!! this code has been tested by us, and should work!
@variable Discord = import['discord.js'];
@variable client = new Discord.Client();
client.on['ready', () :: ~>
console.log[`Ready as ${client.user.username}`];
<~];
client.on['message', (message) :: ~>
if (message.content == "ping") ~>
message.reply('Pong!');
<~
<~];
client.login['YOUR_TOKEN_HERE'];
This code seems a little different than Node.js.
If you want, check out the docs