1.5.2 • Published 5 years ago

@kekse/lib.js v1.5.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

lib.js

Library Extensions

Usable in Node.js and your web browsers (I'll publish my web example(s) and my new homepage code later.. and also the rest of my whole project with it's apps - whichare web and console projects ;-)

Loading and exporting modules

Loading modules in the browser environment is possible, too. Those are all the same modules as for the regular console environment, I thought about cross compatibility (later there will be even more..).

Look into "main.js" at "require()", "include()" and "register()". .. and remember: use "/" for importing and "." for exporting.. but see for yourself in my code...

"global/"

I realized there are some own functions etc. for the most used base classes (like Array, Object, String, etc..) that I use in nearly any project. Extend it as you need/wish to.

BigInt

Extended the "BigInt" object. As I usually need large radix conversions, which are not limited to 36 (Number maximum). So we can parse() and render() any Bytecode/ String now!

Hint: w/o using many arguments you can parse('(2)10101010'); e.g.. so some type of "cast" prefix can be used to decide which radix to use. ;-)

These first two are (nearly) the same, while the last both convert back to string, where (true) produces the '(2)' cast prefix.. and the last line demonstrates the conversion to a real byte-code! ;-)

var big = parse([15,15,15,15], 16);
big = BigInt.parse('(16)ffff');
big.render(2, true);
big.render(256);

There are some other possibilities, including a switch whether to use an alphabet or directly use the "digits" as ASCII/UTF says.. etc. ...

"global/Arguments"

Please do not use '.prototype' in your further implementations. Do like it is .. ... as we get this prototype of the 'arguments' object by:

Arguments = (function() { return arguments.__proto__; })();

Executables

Interpreter

Instead of using "require('lib.js')" in your scripts, just put a symlink to this repository at "bin/node.js", which will always use this "lib.js". It just loads this library plus the script in "process.argv".. use it as regular Shebang, pls.

#!/usr/bin/env node.js

Version of "Node.js"

To easily check for newer official versions (the development branch..), you can use my script "bin/version.js". ..

... just sudo ln -s /home/$USER/lib.js/bin/version.js! Same with "node.js", see the sub section above this one. :-)

Documentation

... will follow later.. very late. But you just need to take a look to the code!

Copyright and License

MIT License. Copyright (c) 2019 Sebastian "Kuchen" Kucharczyk kekse.biz@gmail.com.

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.15

5 years ago

1.1.14

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago