Syntatical
How and why I made Syntatical (an NPM package that changes how you write JavaScript)
Basics of Syntatical:
Goal:
The initial goal was to make an NPM package that changed how JavaScript is written. Not to make it "easier" or "weirder", just a different way to write it.
How it works:
Syntactical basically just puts JavaScript code into functions. Making multi-line functions one-line. It also makes console.log shorter, I did this because I hate using console.log() to log everything.
To show it better I will use a snippit from the index file
"arr_buff":function(num){ if(isNaN(num) == false){ var b = new ArrayBuffer(num); console.log(b.byteLength); } else if(Array.isArray(num)){ var x = num.length; console.log(x) } else { console.log("input invalid") } },
This basically takes
if(isNaN(num) == false){ var b = new ArrayBuffer(num); console.log(b.byteLength); } else if(Array.isArray(num)){ var x = num.length; console.log(x) } else { console.log("input invalid") }
and shrinks it down to
s.arr_buff(633) // ------ OR ------ // You can use: s.arr_buff(["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"])
The one on top will print out: 633
The one bellow will print out: 26
s.arr_buff("a string, not an array")
This one will print our "input invalid"
Why Node.js and NPM?
JavaScript's syntax is fine, but I thought I could make it simple. I would have done it in Python if I felt like Python needed this, which I feel it really does not.
JavaScript's syntax is easy, but I wanted to make it easier.
How to install and use:
Install script
Quotenpm i syntatical
and view the Syntatical NPM repo
What does the future hold for Syntatical?
A lot actually. I am going to gather a few friends to continue development on the main Syntatical package.
Plans for syntatical-electron, syntatical-discord, syntatical-express and syntatical-passport do exist and are being considered. Having a Syntatical.py module is also in thought, same with a Syntatical.lua package. However these are plans in consideration, not yet confirmed!
0 Comments
There are no comments to display.