1.0.9 β’ Published 2 years ago
slangscript v1.0.9
welcome to slang script π
auther : Damian Mostert email : swapswap365@gmail.com 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