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

inline-script

v1.0.5

Published

```js <tag script="this..."></tag> ```

Readme

inline-script

<tag script="this..."></tag>

inline-script is so small library just like onevent properties. it is just script attribute with this represents the element itself like this to onclick. So you can wrap $(this) with jquery, jquery-like library or whatever and use it for all your needs.

inline-script is second stepping to complete hypermedia api's to have "islands of interacivity". We could also call this hypermedia friendly scripting.

There are already solutions to this hyperscript and hx-on by htmx, surreal by gnat and also alpine.js by calebporzio and more. They are all great. They all have some level of unique styles to do dom manipulations.

Usage

<script src="https://www.unpkg.com/inline-script"></script>

inline-script can be used by cdn or by downloading.

Samples

simple on click change text with without any other library

<h1 script="this.addEventListener('click', () => this.innerHTML='changed!')">will change</h1>

change next element with jquery or cash

    <button script="$(this).on('click', () =>$(this).next().css({'background-color': 'red'}) )">make it red to see</button>
    <span style="height: 100px; width: 100px; background-color: black;">hello there</span>

sending and handling custom events jquery or cash

<input script="$(this).on('keyup', ()=> $(this).next().trigger('input-changed', [this.value]))">
<h1 script="$(this).on('input-changed', (ev, data)=> $(this).text(data))"> </h1>

handling data-fetching on client jquery:

<article style="width: 500px;" script="$.when(getWeatherOf([39.9, 32.8])).done(data => {
    $(this).find('h3').text('🌤   '+ data.current_weather.temperature + '°C');
    $(this).find('h4').text('🌬️   '+data.current_weather.windspeed + ' Wind Speed')
})">
    <header><h1>Weather</h1></header>
    <main>
        <h3></h3>
        <h4></h4>
    </main>
    <footer> Open-Meteo Weather API | Free Weather Forecast API for non-commercial use </footer>
  </article>

helper function in script

<script>
    async function getWeatherOf(coordinates) {
        const [latitude, longitude] = coordinates;
        const apiUrl = `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current_weather=true`;

        try {
            const response = await fetch(apiUrl);

            if (!response.ok) {
                throw new Error(`Failed to fetch data from Open-Meteo API: ${response.status}`);
            }
            console.log(response)
            const data = await response.json();
            console.log(data)
            return data // You can process and display the data as needed
        } catch (error) {
            console.error(`Error fetching data from Open-Meteo API: ${error.message}`);
        }
    }
</script>

More context on hypermedia friendly scripting and inline-script

You could easily solve most of your needs with other hypermedia friendly libraries: hyperscript: solves everything but with it's Hypercard-like syntax. It has some awesome features, with my personal favorite being its asynchronous transparency." hx-on: solves most of need for inline-script with two main difference. 1) hx-on is bound to htmx as expected 2) inline-script has no assumption about your code or when to work, without any event it could just work on load. surreal: is the library is most alike to inline-script. it bind element to me() (and more) to script but have more jquery-like functions to handle more. inline-script is just binding element to this without more functionality. alpine.js: is the reactive one, it is like vue, react or svelte but its code resides in html. It is more unique then others and has great api. native-dom-functions: is the one you need, if all you want it basic events and nothing more.

inline-script works great with

The touchstone of web development: jquery or lightweight alternatives of it: cash, umbrella

You can use inline-script with whatever you want, especialy even your custom tool never saw sunlight 🤓

one more thing

<h1 inline-script="this.textContent='wow, script tag changed to something else 😱'"></h1>
<script>
    window.inlineScriptSelector = "inline-script"
</script>

By any chance you might want to change script attribute to something else so you can use window.inlineScriptSelector and set it your choice of words. The main reason we have this is by any chance inline-script and hyperscript mixed together, even tough hyperscript uses _ attribute to work, it also uses script and data-script

Size

| Size | inline-script | | ------------------ | ----------- | | Unminified | 1.4 KB | | Minified | 470 B | | Minified & Gzipped | 330 B |