npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kekse/lib.js

v1.5.2

Published

Library extensions (both for command line and web browser)

Downloads

127

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 [email protected].