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

@xassist/xassist-main

v1.0.4

Published

main functions with onready, id-generator and templating engine

Readme

@xassist/xassist-main

This module provides some helperfunctions like onready, id-generator and templating engine

Installation

If you use NPM, you can install the module via npm install xassist-main. Otherwise, you can download the latest minified file. Be aware any dependencies are not installed by default; you should consider downloading them yourself. If you want, you can install the complete library from github xassist, this includes all dependencies you may need.

The module uses UMD and supports AMD, CommonJS and vanilla environments. Using vanilla: the xaglobal is exported:

<script>
xa.id()
</script>

API

id()

The function id() returns a unique identifier

xa.id() \\returns an unique identifier
xa.id("prefix") \\returns "prefix_"+unique identifier

Parameters for id()

id() takes 1 parameters:

  • prefix [String,defaults to: ""]:This parameter will be used as a prefix for the id.

Result for id()

The value it returns is a String-formatted Number

ready()

The function adds a callback to the DOMContentLoaded-event, it get's executed when this event is triggered. or immediatly, when the DOM was allready ready.

ready(callBack::function [,thisArg])

ready() returns nothing.

Parameters for ready()

ready() takes 2 parameters:

  • callBack [Function]:The listener to be attached to the DOMContentLoaded-event
  • thisArg [any datatype,defaults to: document]:the execution-context of the function

Example for ready()

xa.ready(cb)    \\executes cb(eventDetails) (this inside cb references the document)
xa.ready(cb,thisArg)  \\executes cb(eventDetails) (this inside cb references thisArg)

template()

A basic templating engine, which replaces substrings in a String based on a given object and his keys.

xa.template(txt,obj,strNotFound)

Parameters for template()

template() takes 3 parameters:

  • txt [String]:the base tekst where the templating-engine needs to change certain substrings (it replaces all ${objKey})
  • obj [Object]:the lookup-object to find the defined key's in txt
  • strNotFound [String,defaults to: ""]:when the respective key is not found in the lookupObject, the template get's replaced by this string

Result for template()

the string with all its replaced substrings

Example for template()

xa.template('start${a}${b.c.d}${b.c.d.e}',{a:"OK",b:{c:{d:"VERYDEEP"}}},"notfound") \\returns 'startOKVERYDEEPnotfound'

DevDependencies

  • csv2readme: read csv file with fixed format and parse a readme markdown file
  • jsdom: A JavaScript implementation of many web standards
  • rimraf: A deep deletion module for node (like rm -rf)
  • rollup: Next-generation ES6 module bundler
  • tape: tap-producing test harness for node and browsers

License

This module is licensed under the terms of GPL-3.0.