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

@topmyster/funcscript

v1.0.0

Published

A JS Library built with JavaScript functions

Readme

FuncScript

A lightweight JavaScript library that provides functional utilities for DOM manipulation, variables, math operations, and control flow.

Installation

npm install @topmyster/funcscript

Or install from GitHub:

npm install github:TopMyster/FuncScript

Usage

import { doc, vars, markup, math } from '@topmyster/funcscript';

// Variables
vars.set('counter', 0);
vars.addVar('counter', 5);
console.log(vars.get('counter')); // 5

// DOM Manipulation
const button = markup.newEl('button', 'myBtn', { class: 'btn' }, 'Click me');
markup.appendEl('app', button);

// Events
doc.event('myBtn', 'click', () => {
    doc.log('Button clicked!');
});

// Conditionals
doc.cond('if', vars.get('counter') > 0, () => {
    doc.log('Counter is positive');
});

// Math
math.add(10);
math.mul(2);
console.log(math.clear()); // 0

API Reference

vars - Variable Management

  • vars.decl(varName, value) - Declare a variable
  • vars.set(varName, value) - Set a variable value
  • vars.get(varName) - Get a variable value
  • vars.addVar(varName, value) - Add to a variable
  • vars.subVar(varName, value) - Subtract from a variable
  • vars.mulVar(varName, value) - Multiply a variable
  • vars.divVar(varName, value) - Divide a variable
  • vars.remove(varName) - Remove a variable
  • vars.clearVars() - Clear all variables

markup - DOM Manipulation

  • markup.newEl(el, id, props, content) - Create a new element
  • markup.appendEl(id, content) - Append to an element
  • markup.prependEl(id, content) - Prepend to an element
  • markup.delEl(id) - Delete an element
  • markup.updateEl(id, props, content) - Update an element
  • markup.replaceEl(id, content) - Replace an element

doc - Document Utilities

  • doc.log(x) - Console log
  • doc.alert(x) - Show alert
  • doc.event(id, event, callback) - Add event listener
  • doc.cond(statement, condition, result) - Conditional execution
    • Statements: 'if', 'else', 'while', 'for'

math - Math Operations

  • math.add(number) - Add to total
  • math.sub(number) - Subtract from total
  • math.mul(number) - Multiply total
  • math.div(number) - Divide total
  • math.clear() - Reset total to 0

Examples

See the examples/ directory for a counter demo.