# @kekse/lib.js

> Library extensions (both for command line and web browser)

Latest version **1.5.2** (published 2019-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kekse/lib.js
pnpm add @kekse/lib.js
yarn add @kekse/lib.js
bun add @kekse/lib.js
```

Provides the commands `node.js`, `version.js`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2019-06-29 |
| First published | 2019-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 107.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian Kucharczyk |
| Maintainers | kekse |

## Links

- npm: https://www.npmjs.com/package/@kekse/lib.js
- Homepage: https://lib.kekse.biz/
- npm.io page: https://npm.io/package/@kekse/lib.js

## Recent versions

- 1.5.2 (latest) — 2019-06-29
- 1.5.1 — 2019-06-29
- 1.5.0 — 2019-06-29
- 1.4.6 — 2019-06-29
- 1.4.5 — 2019-06-29
- 1.4.4 — 2019-06-29
- 1.4.3 — 2019-06-29
- 1.4.2 — 2019-06-29
- 1.4.1 — 2019-06-29
- 1.4.0 — 2019-06-29
- 1.3.1 — 2019-06-25
- 1.3.0 — 2019-06-25
- 1.2.9 — 2019-06-24
- 1.2.8 — 2019-06-24
- 1.2.7 — 2019-06-24
- … 25 more at https://npm.io/package/@kekse/lib.js/versions

## README

# 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>.

---
_Source: https://npm.io/package/@kekse/lib.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
