slangscript
v1.0.9
Published
the slang compiler
Downloads
3
Readme
welcome to slang script 😋
auther : Damian Mostert email : [email protected] slang lang is an adaptable script allowing you to edit java scirpt with a word list, I will soon have many available, my mission is to make java script not just a fully writable language in english santax, but in every language there is :),
current built in languages
• english, is also defualt • mandrin • russian • hindi • afrikans more comming soon :)
install
npm i slangscript
usage
//in your app.js
const fs = require('fs');
const slang = require("slangscript")
fs.readFile('api.slang', 'utf8', function(err, data){
eval(slang.compileString({
data:data,
lang:"eng"
/*avalable language options
eng english
mand mandrin
afr afrikans
ru russian
hin hindi
*/
}))
//eval(slang({data:data,coffee:true})) // for coffiescript
});
//and in your api.slang
num is 0
if(num bigger than 2){
console.log("num is bigger than 2")
}else if(num smaller than 2){
console.log("num is smaller than 2")
}
/*afr example
V is 0
as(V grooter as 2){
console.log("num is bigger than 2")
}anders as(V kliener as 2){
console.log("num is smaller than 2")
}anders{
console.log("num is 2")
}
*/
/* mandrin example
num 是 0
如果(num 大于 2){
console.log("num is bigger than 2")
}否则如果(num 小于 2){
console.log("num is smaller than 2")
}别的{
console.log("num is 2")
}
*/
// now just run node app.js
// you will now find that you can write javascript with english santax :)
// alot more language librarys comming soon
// i apologize if some of my santax is incorect with some languages, I only know eng, you can email me and ill fix it :)
// this is what slangscript can do :) crazy right?
how to use custom list
const slang = require("slangscript")
slang.compile({
customList:[
[" is ","="]
],
data:`
X is hey
`,
//result is " X = hey "
})
command line usage
once you installed slangscript npx slang should be avalable as a command, this is for executing js files with slang santax
npx slang yourfile.slang
with coffeescript :
npx slang yourfile.slang coffee
using alternative languages, defualt is english mandrin example :
npx slang yourfile.slang mandrin
with coffeescript :
npx slang yourfile.slang mandrin coffee