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

sr-js

v1.0.8

Published

SR JS: Pure JavaScript (JS) library for DOM manipulation, events, and animations

Readme

SeoRomin JS Library (SR JS)

A pure JavaScript library for DOM manipulation, events, and animations. It provides a familiar chaining syntax while utilizing modern browser APIs for maximum performance.

Docs

Installation

Include the minified script in your HTML file before your custom scripts.

<!DOCTYPE html>
<html lang="en">
<head>
     <meta charset="UTF-8">
     <title>My App</title>
</head>
<body>
     <h1>Hello World</h1>

     <!-- Include SR JS -->
     <script src="sr.min.js"></script>

     <!-- Your Code -->
     <script>
          // Wait for DOM Ready
          $(function() {
                $('h1').text('SR JS is working!');
          });
     </script>
</body>
</html>

Add to your project:

<script src="sr.min.js"></script>

Or use a CDN:

jsDelivr is a great open-source service that lets you use projects without ever downloading the code.

<script src="https://cdn.jsdelivr.net/npm/sr-js@latest"></script>

Or get it:

Download SR JS

Or install with npm:

NPM is a front-end package manager that simplifies adding new packages.

npm i sr-js

Some examples

Basic GET Request

$.ajax({
     url: '/api/users',
     method: 'GET',
     dataType: 'json',
     data: { page: 1, limit: 10 }
})
.then(response => {
     console.log('Success:', response);
})
.catch(error => {
     console.error('Request failed:', error);
})
.finally(() => {
     console.log('Cleanup actions');
});

Delegated binding with namespaces

$('#container').on('click.myPlugin', '.btn', function() {
     console.log('Button inside container clicked');
});

Toggle class

$('div').toggleClass('active');

Create element

const $card = $.t('<div>', {
     class: 'card',
     html: '<h1>Title</h1>',
     css: { border: '1px solid black' },
     data: { id: 101 }
});

... Refer to the docs folder for more details.

Extending SR JS

You can easily extend the library with custom plugins or static methods.

1. Add an Instance Plugin

Use $.plugin to add methods available on SR objects (like $('div').myMethod()).

$.plugin('color', function(color) {
     this.css('color', color);
     return this; // Enable chaining
});

// Usage
$('p').color('red');

2. Add a Static Method

Use $.method to add utility functions directly to the $ object.

$.method('sum', function(a, b) {
     return a + b;
});

// Usage
console.log($.sum(10, 20)); // 30

When to use

  • You need a stable and predictable library.
  • You repeatedly write the same boilerplate code.
  • You need to increase your development speed.
  • You don’t want to constantly rewrite your own helper functions.
  • You need the ability to extend the library with plugins or custom methods.
  • You need fast, optimized, and modern code.
  • You want to reduce the final bundle size (depending on the project).
  • You want a consistent API that keeps your codebase clean and easy to maintain.
  • You need a solution that behaves consistently across all modern browsers.
  • You want a library that helps prevent common bugs by providing well-tested utilities.
  • You want something lightweight but powerful enough to cover most daily tasks.

Browser Support

This library relies on modern JavaScript features including Proxy, WeakMap, and structuredClone. Below is the minimum browser support matrix.

| Browser | Version | Release Date | | :--- | :--- | :--- | | Google Chrome | 98+ | Feb 2022 | | Mozilla Firefox | 94+ | Nov 2021 | | Apple Safari | 15.4+ | Mar 2022 | | Microsoft Edge | 98+ | Feb 2022 |

Author and License

Created and maintained by Roman Orlovskiy (SeoRomin) under the MIT license.