npm

Need private packages and team management tools?Check out npm Orgs. »

bape

1.1.8 • Public • Published

Bape - A Bathing Ape

Some useful Javascript functions and CSS style to reduce dumb work.
Inspired by Lodash.

Browser Support

Modern browsers and IE 11+

Installation

npm i bape --save

Example

// client
import random from 'bape/random'
 
random(0 , 1000) // generate a random integer number between 0 ~ 1000
// server
const random = require('bape/random')
 
random(0 , 1000) // generate a random integer number between 0 ~ 1000

API

Assertion

  • isObject(input)
  • isPlainObject(input)
  • isEmptyObject(input)
  • isNumber(input)
  • isJSON(input)
  • isURL(input)

Cookie

  • cookie

Generate random things

  • random(min = 0, max = 100, floating = 0)
  • randomString(length = 8)
  • randomCnString(length = 8)

Others

  • isEnter(e)
  • formatJSON(value, replacer = null, space = 2)

Function

  • once(fn)
  • noop()
  • debounce(fn, wait, options)
  • throttle(fn, wait, options)

Array

  • remove(arr, item)

Dependency

install

npm i bape

Downloadsweekly downloads

34

version

1.1.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability