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

codewonders-helpers

v1.1.0

Published

A Small Helpers Utility Functions For Javascript Development

Downloads

71

Readme

Codewonders

Codewonders Helpers npm

NPM

This is a small helpers utility functions for javascript development. In here are the regular functions i use in my development feel free to contribute.

Helper Functions

Array Helpers

  • arrayRandomItem - This allows you pick a random item in an array see more here

  • arrayPickOne - This allows you pick a random item with its index in an array see more here

  • arrayShuffleItems - This allows you to switch array index on document loaded in an array see more here

  • arrayRemove - This allows you to remove item from with a cb an array see more here

  • join - This allows you to join items in an array with different seperators start and end in an array see more here

Bind Helper

  • bind - This allows you to bind functions / curried functions see more here. takes in fn , context , boundArgs

Collect Into Helper

  • collectInto - This collects functions into with an argument here. takes in args

Cookie To Object Helper

  • cookieToObject - Converts cookie to object here. takes in cookie

Countries Helpers

  • countries-by-calling-code - Gets country and their call codes here.

  • countries-by-curreny-code - Gets country and their currency codes here.

  • countries-by-states - Gets country and their states here.

Encode and Decode

  • encode - encodes string to base 64 here. takes in string

  • decode - decodes encoded string from base 64 here. takes in string

  • utf8encode - encodes string to utf8 here. takes in string

  • utf8decode - decodes encoded string from utf8 here. takes in string

Cookie To Object Helper

  • getRandomColor - returns random color here. returns color in HEX

Still documenting :)

Install

$ npm install codewonders-helpers --save

Usage

Getting familiar with the package and you want to use some helper functions like isEmpty, isJsonString ,pxToRem helpers and e.t.c you can easily just export them the following ways.

import { isEmpty } from 'codewonders-helpers';

All methods are exported as a flat namesapce so you can also call them like this

import isEmpty from 'codewonders-helpers/bundle-es/is-empty';

or

var isEmpty = require('codewonders-helpers');

and then we have the exported helpers and can already do this

isEmpty({});
// => true

MIT © codewonders.dev  ·  GitHub @adenekan41 / codewonders >  ·