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

bue

v1.0.4

Published

Bue for Baiji(Utils tools)

Downloads

18

Readme

Bue

Build Status

Lead Maintainer: Oliver Wang

Node utilities shared amongst the extended baiji universe

Usage

Installation

npm install bue

Usage

var biu = require('bue');

bue.isArray([1,2,3]);
// => true

Method

All the functions used in Bue is based on lodash(v4.0.0-pre), some of them have been customized(italic) in the following list.

Language Functions

  • clone
    Creates a shallow clone structured clone algorithm of value.
      bue.clone(value)
  • isArray
    Checks if value is classified as an Array object.
      bue.isArrayLike(value)
  • isBoolean
    Checks if value is classified as a boolean primitive or object.
      bue.isBoolean(value)
  • isDate
    Checks if value is classified as a Date object.
      bue.isDate(value)
  • isEmpty
    Checks if value is empty. A value is considered empty unless it's an arguments object, array, string, or jQuery-like collection with a length greater than 0, an object with own enumerable properties or a number.
      bue.isEmpty(value)
  • isFunction
    Checks if value is classified as a Function object.
      bue.isFunction(value)
  • isLength
    Checks if value is a valid array-like length.
      bue.isLength(value)
  • isNil
    Checks if value is null or undefined.
      bue.isNil(value)
  • isNull
    Checks if value is null.
      bue.isNull(value)
  • isNullOrUndefined Checks if value is null or undefined.
      bue.isNullOrUndefined(value)
  • isNumber
    Checks if value is classified as a Number primitive or object.
      bue.isNumber(value)
  • isInteger Checks if value is an integer.
      bue.isInteger(value)
  • isObject
    Checks if value is the language type of Object.
      bue.isObject(value)
  • isPlainObject
    Checks if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.
      bue.isPlainObject(value)
  • isPresent
    Check if value is not Empty
      bue.isPresent(value)
  • isRegExp
    Checks if value is classified as a RegExp object.
      bue.isRegExp(value)
  • isString
    Checks if value is classified as a String primitive or object.
      bue.isString(value)
  • isUndefined
    Checks if value is undefined.
      bue.isUndefined(value)

Array Functions

  • compact
    Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.
      bue.compact(array)
  • flatten
    Flattens array a single level.
      bue.flatten(array)
  • first
    Gets the first element of array.
      bue.first(array)
  • last
    Gets the last element of array.
      bue.last(array)

Object Functions

  • extend
    Assigns own enumerable properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources but it iterates over own and inherited source properties.
      bue.entend(object, [sources])
  • get
    Gets the value at path of object. If the resolved value is undefined the defaultValue is used in its place.
      bue.get(object, path, [defaultValue])
  • hasIn
    Checks if path is a direct or inherited property of object.
      bue.hasIn(object, path)
  • keys
    Creates an array of the own enumerable property names of object.
      bue.keys(object)
  • keysIn
    Creates an array of the own and inherited enumerable property names of object.
      bue.keysIn(object)
  • values
    Creates an array of the own enumerable property values of object.
      bue.values(object)

String Functions

  • pad
    Pads string on the left and right sides if it's shorter than length. Padding characters are truncated if they can't be evenly divided by length.
      bue.pad([string=''], [length=0], [chars=' '])
  • padLeft
    Pads string on the left side if it's shorter than length. Padding characters are truncated if they exceed length.
      bue.padLeft([string=''], [length=0], [chars=' '])
  • padRight
    Pads string on the right side if it's shorter than length. Padding characters are truncated if they exceed length.
      bue.padRight([string=''], [length=0], [chars=' '])
  • escapeRegExp Escape RegExp special characters.
      bue.escapeRegExp([string=''])

Collection Functions

bue.iteratee: a function that a invokes func with the arguments of the created function.

  • each
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.
      bue.each(collection, [iteratee = bue.identity])
  • eachRight
    This method is like bue.each except that it iterates over elements of collection from right to left.
      bue.eachRight(collection, [iteratee = bue.identity])
  • map
    Creates an array of values by running each element in collection through iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).
      bue.map(collection, [iteratee = bue.identity])

Math Functions

  • max
    Computes the maximum value of array. If array is empty or falsey undefined is returned.
      bue.max(array)
  • min
    Computes the minimum value of array. If array is empty or falsey undefined is returned.
      bue.min(array)

Assertion Testing

  • assert The assert module provides a simple set of assertion tests that can be used to test invariants, based on nodejs core module assert

License

MIT