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

fluentx

v0.0.9

Published

Fast, fluent, simple web builder

Readme

fluentX - Fast, fluent, simple web builder.

Inspired by jQuery, but not selecting query anymore, just create it.

Usage

import { $ } from 'fluentx'

const $app = $('app').content([
    $('h1').content('Hello World!')
])

document.body.append($app.dom) // render $app

Forget HTML, create any element just like this

$('a') 

Yes, Fluent Method.

$('h1').class('amazing-title').css({color: 'red'}).content('Fluuuuuuuuuuuuent!')

Single Page App with Router

const router = new Router('/')
    // example.com
    .addRoute(new Route('/', () => 'Welcome to your first page!'))

    // example.com/user/anyusername
    .addRoute(new Route('/user/:username', (params) => {
        return $('div').content([
            $('h1').content(params.username)
        ])
    }))

    .listen() // start resolve pathname and listen state change

// prevent jump to other page from <a> link
$.anchorPreventDefault = true;
$.anchorHandler = (url) => { router.open(url) }

$('a').href('/about').content('Click me will not reload page.')

Insert element(s) with condition

// Example 1
$('div').content([
    $('h1').content(params.username),
    // conditional
    params.username === 'admin' ? $('span').content('Admin is here!') : undefined
])

// Example 2
$('div').content([
    $('h1').content(params.username),
    params.username === 'alien' ? [
        // the elements in this array will insert to <div> when conditional is true
        $('span').content('Warning'),
        $('span').content('You are contacting with alien!')
    ] : undefined
])

Replace or Insert

$('div').content(['1', '2', '3']) // 123
    .content(['4']) // 4
    // content method will replace children with elements

    .insert(['5', '6', '7']) // 4567
    // using insert method to avoid replacement

    .class('class1, class2') // class1, class2
    // class method is replacement method

    .addClass('class3') // class1, class2, class3
    // using addClass method

Multiple element builder

$('ul').content([
    // create 10 <li> element with same content
    $.builder('li', 10, ($li) => $li.content('Not a unique content of list item!'))

    // create <li> element depend on array length
    $.builder('li', [
        // if insert a function,
        // builder will callback this function after create this <li> element
        ($li) => $li.css({color: 'red'}).content('List item with customize style!'),
        
        // if insert a string or element,
        // builder will create <li> element and insert this into <li>
        'List item with just text',
        $('a').href('/').content('List item but with a link!')
    ])
])

Element builder with function

// This is a template function that return a <div> element
function UserCard(name: string, age: number) {
    return $('div').content([
        $('h2').content(name),
        $('span').content(`${bio} year old`)
    ])
}

// A user data array
const userDataList = [
    { name: 'Amateras', age: 16 },
    { name: 'Tsukimi', age: 16},
    { name: 'Rei', age: 14},
    { name: 'Ichi', age: 14},
]

// This function will create 10 UserCard element with same name and age
// Using tuple [Function, ...args] to call function with paramerters
$.builder([UserCard, 'Shizuka', 16], 100)

// This function will create UserCard with the amount depend on array length
$.builder(
    UserCard, 
    userDataList.map(userData => [userData.name, userData.age]))

// Same result as (prefer)
userDataList.map(userData => UserCard(userData.name, userData.age))