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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rjfwhite/random-lib

v0.0.7

Published

Core engine for MML

Downloads

6

Readme

AingineLib

A TypeScript library that builds to a self-contained ES module for browser usage.

Setup

  1. Install dependencies:
npm install
  1. Build the library:
npm run build

This creates a bundled ES module at dist/index.js that can be included in any webpage.

Usage

In HTML with ES Modules

<script type="module">
  import AingineLib from './dist/index.js';
  
  const lib = new AingineLib({ debug: true });
  console.log(lib.greet('World'));
</script>

With Query Parameters

You can pass configuration via query parameters in the script src:

<script type="module">
  import AingineLib, { getModuleParam } from './dist/index.js?foo=bar&debug=true&theme=dark';
  
  const lib = new AingineLib();
  
  // Extract query parameters
  console.log(lib.getQueryParam('foo')); // 'bar'
  console.log(lib.getQueryParam('debug')); // 'true'
  console.log(lib.getQueryParams()); // { foo: 'bar', debug: 'true', theme: 'dark' }
  
  // Or use standalone functions
  console.log(getModuleParam('theme')); // 'dark'
</script>

As a Package

import AingineLib from 'aingine-lib';

const lib = new AingineLib({
  debug: true,
  theme: 'dark'
});

// Use the library
console.log(lib.greet('Developer'));
const button = lib.createButton('Click me!', () => alert('Clicked!'));
document.body.appendChild(button);

Development

  • npm run build - Build production bundle (minified)
  • npm run build:dev - Build with watch mode for development
  • npm run build:types - Generate TypeScript declaration files
  • npm run build:all - Build both bundle and types
  • npm run dev - Start development mode with watch
  • npm run clean - Clean dist folder
  • npm run serve - Start HTTP server on port 3000
  • npm run start - Build and start server
  • npm run demo - Build, start server, and open browser

Features

  • ✅ Self-contained ES module bundle
  • ✅ TypeScript support with type declarations
  • ✅ Minified production build
  • ✅ Source maps for debugging
  • ✅ Fast builds with esbuild
  • ✅ Works directly in browsers with <script type="module">
  • ✅ Query parameter extraction from module URL

Query Parameter API

The library provides several ways to extract query parameters from the module URL:

Standalone Functions

import { getModuleParam, getModuleParamsObject, getModuleQueryParams } from './dist/index.js?foo=bar&debug=true';

// Get a specific parameter
const foo = getModuleParam('foo'); // 'bar'

// Get all parameters as an object
const allParams = getModuleParamsObject(); // { foo: 'bar', debug: 'true' }

// Get raw URLSearchParams object
const params = getModuleQueryParams(); // URLSearchParams instance

Instance Methods

import AingineLib from './dist/index.js?user=john&config=prod';

const lib = new AingineLib();

// Get a specific parameter
lib.getQueryParam('user'); // 'john'

// Get all parameters
lib.getQueryParams(); // { user: 'john', config: 'prod' }

// Check if parameter exists
lib.hasQueryParam('user'); // true
lib.hasQueryParam('missing'); // false

Browser Support

The generated ES module works in all modern browsers that support ES modules:

  • Chrome 61+
  • Firefox 60+
  • Safari 10.1+
  • Edge 16+