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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pico-common

v0.15.2

Published

pico common tools

Downloads

112

Readme

pico-common

A pico sized (~ 7kb) with zero dependency javascript library for commonly overlooked utility functions for both nodejs and the browser.

this library goes well with commonly used libraries such as lodash and react with little or no overlapping.

features

Below are the main features

data validator

A data driven data validator, suitable for simple to very complicated data structure. all you need is

  1. define a schema/specification of your data
  2. pass the schema and your data to the validator
  3. it returns the result

read more

deep merging

Like Object.assign but it does deep merging for object and array

read more

route parser & route builder

building something like express router? this function can help you

/pico/common/str/route + /pico/:lib/:mod/:fun -> {lib: 'common', mod: 'str', fun: 'route}

/pico/:lib/:mod/:fun + {lib: 'common', mod: 'str', fun: 'route} -> /pico/common/str/route

read more

cronjob

Need a cron schedule expressions parser? this is a pure javascript implementation can run on the browsers and nodejs. designed to work with setTimeout

read more

a javascript test framework for javascript lovers

expect('style').is.very.hard.to.remember.and.use('?'). Javascript operators is all you need.

this framework supported serial and pararellel test cases execution.

read more

module

A list of functions to you help to build your own sandbox module/dependency with asynchronous loader (similar to AMD)

read more

call stack

printing javascript function call stack? this is for you

read more

cleaner JSON.parse and JSON.stringify

these parse and stringify functions are designed to avoid unnecessary json stringify and parse and stringify-again in your workflow

for example

  • A frontend stringified a big data structure for a request body
  • expressjs bodyparser parsed entire request body but only part of them are use in server-side logic
  • backend's model stringified part of the request body again and save it to db

with these functions

  • frontend specially stringify the server needed data and db needed data in one string
  • backend only parse backend needed data for server-side logic
  • database needed can be saved as it is to db without stringification

read more

json path

xpath for json

read more

optional chaining

A data driven optional chaining, a optional chaining that can be saved and transport over network

read more

html template engine

A 23 LOC html template engine

read more

installing

click here browser and nodejs installation instruction