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

simhok

v1.1.2

Published

A lightweight and easy-to-use library for features you probably use every day

Downloads

13

Readme

SimHok

licence badge last commit badge downloads badge npm version badge size badge

A lightweight and easy-to-use library for features you probably use every day.

Check the documentation to see all available functions.

Install

$ npm install simhok
// or
$ yarn add simhok

Import

// Import what you need
import { len, log } from "simhok";

// Import all functions
import * as Sim from "simhok";

// In node.js
const { len, log } = require("simhok");

Available functions

const user = "sebastian";
const users = ["sebastian", "klaudia"];
const hello = "hello world";

len(user);             // number:9
len(users);            // number: 2
capitalize(hello);     // string: Hello world
capitalizeAll(hello);  // string: Hello World
upper(user);           // string: SEBASTIAN
lower(user);           // string: sebastian

startsWith(user, "s"); // boolean: true
startsWith(user, "S"); // boolean: false
endsWith(user, "n");   // boolean: true

rstrip(user, "an");    // string: sebasti
lstrip(user, "s");     // string: ebastian

split(user, [0]);      // string: s
split(user, [0, 2]);   // string: se
split(user, [3, 0]);   // string: astian
split(user, [0, -3]);  // string: ian

// start from 4 character and get 3 next characters
mid("Roland Watson", 4, 3) // string: and

let james_bond = 7;
zfill(james_bond, 2);  // string: 007

count([1,2,1,3,1], 1); // number: 3
compareIgnoreCase("Sebastian", "sebastian"); // boolean: true

flip(42);              // number: -42
flip(-42);             // number: 42

n("1_000_000")         // number: 1000000
rand(1, 100)           // number: 42

rept(1, 10)            // number: 1111111111
rept("1", 10)          // string: 1111111111

clean("This is   inline   String !"); // string: "This is inline String!"

// or with multi lines:
clean(`Is   this    now , 
multi line  String ?  `, true);       
// string:
`Is this now, 
multi line String?`;

log("This is pretty awesome 🎉"); // "This is pretty awesome 🎉"

Example in React

import { len, upper } from "simhok";

const App = () => {
  let name = upper("Sebastian");
  let users = len(["Sebastian", "Klaudia"]);

  return <div>{users > 0 && name}</div>;
};
import * as Sim from "simhok";

const App = () => {
  let name = Sim.upper("Sebastian");
  let users = Sim.len(["Sebastian", "Klaudia"]);

  return <div>{users > 0 && name}</div>;
};