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.
-
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
cban array see more here -
join - This allows you to join items in an array with different seperators
startandendin an array see more here
- bind - This allows you to bind functions / curried functions see more
here.
takes in
fn,context,boundArgs
- collectInto - This collects functions into with an argument
here.
takes in
args
- cookieToObject - Converts cookie to object
here.
takes in
cookie
-
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 - 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
- getRandomColor - returns random color
here.
returns color in
HEX
Still documenting :)
$ npm install codewonders-helpers --saveGetting 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({});
// => trueMIT © codewonders.dev  · GitHub @adenekan41 / codewonders >  ·Â

