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

pytils

v1.40.3

Published

pytils

Downloads

732

Readme

pytils: functions utils like python

many functions that use to simplify my javascript and that the syntax is inspired by python and ramda

I will help if you have any difficulty =)

Contact me by github:heyderpd. I'll be glad to help you.

Thanks for npm~lucasmreis

npm install --save pytils

Example:

const p = require('pytils')

p.compose = function ( _arrayOfFunctions ) // return function waiting for input
p.curry   = function ( _function ) // return function waiting for input
p.path [curry] = function ( _arrPathOfProps, _object ) // return prop of _object in path or undefined
p.reduce = ( _object , fx ) // do each of any type, pass to function var's (key, value) to return a value

p.copy    = ( _object ) // copy any types
p.length  = ( _object ) // get length of any type, return -1 if can't
p.keys    = ( _object ) // get keys of any type, return [] if can't
p.values  = ( _object ) // get values of any type, return [] if can't
p.hasProp = ( _object , prop ) // of any type, return true or false

p.type     = function ( _object ) // return type of var in a string
p.isType   = function ( _object , _type_need) // return true or false
p.isString = function ( _object ) // return true or false
p.isNumber = function ( _object ) // return true or false
p.isArray  = function ( _object ) // return true or false
p.isObject = function ( _object ) // return true or false
p.isFunction = function ( _object ) // return true or false
p.isAOF  = function ( _object ) // return true or false if is isArray OR isObject OR isFunction
p.isNull = function ( _object ) // return true or false
p.isUndefined = function ( _object ) // return true or false

p.toObject = ( _array ) // convert array to object, return object have values of array in keys of object
p.arrayDiff = ( _array base , _array compare ) // compare two array and return the diff values of base
p.invertObj = ( _object ) // convert object keys in value and value in keys
p.uniq = ( _array ) // get unique values of array, work with simple var's
p.eq1True   = ( _array ) // if is a array of one value of true, return true
p.uniqWith  = ( _comparator, _array ) // foreach array and return unique itens with comparator
p.uniqObject  = ( _objectA, _objectB ) // compare all prop of two object and return if is equal
p.ojbFromVals = ( _array ) // create object from array values
p.ifThrow = ( bool, string ) // trow text erro if bool is true

var _function = function( key, value ) { console.log('item: ', keys, ' = ', value) }
p.map [curry] = ( _function , _object ) // do each of any type, pass to function var's (key, value)
p.mapx = ( _object , _function ) // do each of any type, pass to function var's (key, value)

var _dictionary = { toA, 'fromB', toC: 'fromD' }
p.translate [curry] = ( _dictionary, _array ) // translate object using dictionary of props