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 🙏

© 2025 – Pkg Stats / Ryan Hefner

libx.js

v6.1.0

Published

[![MIT license](https://img.badgesize.io/Livshitz/libx.js/master/dist/libx.min.js?compression=gzip)](https://cdn.jsdelivr.net/gh/Livshitz/libx.js@latest/dist/libx.min.js) [![codecov](https://img.shields.io/codecov/c/github/Livshitz/libx.js)](https://codec

Readme

Libx.js

MIT license codecov MIT license npm npm Known Vulnerabilities

🛠 libx.js is a carefully crafted toolbelt full of useful modules and helpers for node & web apps

Description:

Different projects usually have a shared portion of infrastructural or helpers code. Libx.js is intended to bring a broad of useful tools, shaped and sharpened to be easily used, hiding the complex or troublesome routines usually needed.

Features:

  • Heavily modular and flexible
  • Support javascript and Typescript
  • Browserify & bundler friendly
  • Shared support:
    • Modules:
      • Dependency Injection
      • Log
      • Network
      • Callbacks (pub/sub)
      • Firebase wrapper
      • Linked nodes and lists
      • BinrayHeap (min and max)
      • Queue
      • General QueueWorker
      • Datastore for clientside caching
    • Promise and deferred wrappers
    • General helpers & extensions
    • Datastore and cache mechanism
    • Crypto related helpers
    • Many general helpers
  • Browser-only support:
    • General helpers & extensions
    • Require (for browser)
    • User management (firebase)
  • Node-only support:
    • CLI helpers
    • QuickServer (ExpressJS wrapper)
    • ~~Bundler - Watcher, bundler, transformer, and more~~ (moved to pax.libx.js)

Use Cases:

  1. General:
    • Essential string, array, date, extensions:
      • format date into strings
      • string ellipsis, capitalize, padding, hashcode
      • array manipulation
    • Simplified promise wrapper for easily wrapping callbacks into promises
    • Use same API for networking (HTTP get/post/etc) in both browser and node
    • Create dynamic linked-lists and trees to track, traverse nodes and also be able to serialise/deserialize easily
    • Use QueueWorker for handle one or multiple workers and split work into async concurrent handlers
    • Log code flow and events and filter by log level (debug/verbose/info/warning/error), including formatted date and time, stacktrace, etc
    • Use simplified callbacks for easy pub/sub
    • Firebase wrapper for handling read/write access and polyfill some missing functionality (reverse key ordering, entity version, etc.)
    • Helpers for object manipulation, handy types and checks, chain functions, deep clone and extend objects, guid generation, regexp wrappers, and many more
  2. Node:
    • Allow modules to be able to detect and work in both CLI or import modes
    • Quickly access command line arguments
    • Bump package.json version
    • Execute complex shell commands and capture outputs
    • Parse and encrypt/decrypt project.json files
    • Encrypt/decrypt files
    • Globally catch errors and unhandled promises
  3. Browser:
    • Browserify and make all the helpers and modules available to be used (share same codebase for both Node and browser).
    • Support progressive script loading, just like require but in the browser and on demand
    • Events and Messages managers
    • Helpers for download, upload, inject and many more helpers

** See unit-tests and example folder for practical uses and examples. ** Live playground

Related packages:

  1. concurrency.libx.js -
    Module that provides handy helpers for Async and concurrent work, for example Deferred utility, Debounce/Throttle, Chain, measurements and more.
    Was initially part of libx and departed to be independent package.
  2. di.libx.js -
    Light weight Dependency-Injection module.
    Was initially part of libx and departed to be independent package.
  3. pax.libx.js -
    Custom made bundler, based on gulp that supports Browserifying, TS, LESS, SCSS, Vue and more. Used here to bundle libx.js for browser use.

Usage

$ yarn add libx.js
or
$ npm install --save libx.js   

Play with it in browser playground: https://npm.runkit.com/libx.js

For browser: Create a dedicated file, include (e.g: require) the needed modules into global (window) scope and browserify it. See pax.libx.js for more details how to efficiently browserify and bundle files for browser use.

Grab from CDN:

https://cdn.jsdelivr.net/npm/libx.js@latest/dist/libx.min.js

Node: Environment Variable Loading (.env)

Libx.js provides a robust dotenv-equivalent loader for Node.js/TS projects:

Features

  • Loads .env by default, or .env.<env> if an env arg is supplied
  • Allows overriding the .env path as a string or array, merging in order
  • Merges multiple env files in order
  • Applies loaded variables to process.env (without overwriting existing ones)
  • Returns the loaded variables as an object
  • Supports multiline quoted values, escaped characters, inline comments, export keyword, and variable expansion ($VAR, ${VAR})

Usage

import { loadEnv } from 'libx.js/src/node/env';

// Load .env from current directory
loadEnv();

// Load .env.production (merges with .env if both exist)
loadEnv({ env: 'production' });

// Load custom env files in order (merging)
loadEnv({ path: ['.env', '.env.local'] });

// All loaded variables are applied to process.env and also returned as an object
const env = loadEnv();
console.log(env.MY_KEY);

Supported .env Features

  • Unquoted, single-quoted, and double-quoted values
  • Multiline quoted values
  • Escaped characters: \n, \t, \r, \\, \", \'
  • Inline comments (after values)
  • export keyword (optional)
  • Variable expansion: $VAR and ${VAR} (from previous keys or process.env)

See src/node/env.ts and tests in tests/node/env.test.ts for more details and examples.

Contributing

Fork into your own repo, run locally, make changes and submit PullRequests to the main repository.

Tests Coverage:

Code Coverage

License

All projects and packages in this repository are MIT licensed.