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

@meniga/utils

v6.1.36-alpha.0

Published

Small re-usable utils/decorators/helpers for meniga projects

Downloads

1,005

Readme

@meniga/utils

The utils library contains smalls re-usable utils/decorators/helpers for Meniga projects

High Order Component Helpers


This is a set of utility helpers to work with recompose.

componentDidMount

Hook into the component did mount life cycle event in recompose

componentDidUpdate

Hook into the component did update life cycle event in recompose

componentWillReceiveProps

DEPRECATED. Use componentDidUpdate instead.

componentWillMount

DEPRECATED. Use componentDidMount instead.

componentWillUnmount

Hook into the component will unmount life cycle event in recompose

composeConnect

Connect the redux store in a HOC

createContext

Create a context method from a single object in recompose

getWindowSize

Create hooks in recompose that attach to window resizing and store in the windowSize state

getElementPosition

Create hook in recompose that attaches to window event to supply the elements position in the position state

React Utils


createProps

Create a props object with the given PropType

keyboardClick

Create a props object that contains react handlers for keyboard enter and space to trigger an onClick handler

visibleChildren

Returns a flattened list of child elements

Redux


createTypes

Create a list of types with a given prefix

reducerUtils

Some utility functions for setting known properties on state such as error information

Other


containsValue

Test if the first string includes the second string

formatText

String format

isEqualValue

Does case insensitive string comparison

shouldUpdate

Takes in a set of props to watch and detects if they have changed at all between 2 props objects

textRelevance

Sort a result set by relevance with a given matchText

uuid

Generate a unique (UUID format) id string

triggerResize

Dispatch a resize event to the window object

Device Detection

Detect various devices:

  • isMobile
  • isMobileOrTablet
  • isTablet
  • isIOS
  • isAndroid

queryUtils

Utility functions for working with the query string

  • getQueryString
  • appendToQuery
  • getFilterQuery
  • getIncludeQuery
  • getSkipAndTakeQuery

Data


makeTree

Make a tree from a parent / child structure

addOtherToCategoryTree

Add 'other' category to category tree

sortArray

Sorts an array of strings or an array of objects