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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@evolis/evolis-library

v1.2.8

Published

Dependencies used both in Evolis API and Evolis UI

Downloads

15

Readme

Evolis Library

A simple package that groups together frequently used functions in front-end and in back-end at Evolis.

Note

This package is marked as public and you can use it under the MIT license. But most of this stuff may be useless to you and you can probably find another good library that fits your needs.

Warning: Breaking changes since 1.2.0

Install

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install --save @evolis/evolis-library

Usage

This module is divided into six sub-modules with "Evo" as prefix: EvoArray, EvoDate, EvoMisc, EvoNumber, EvoObject and EvoString. Import it into your script using:

import { EvoArray, EvoMisc, ... } from "@evolis/evolis-library";

EvoArray

  • Checkers

    • isArray(value: any)
      • value: The value to test
      • return: true if the value is an array
    • isDeepEqual(array1: Array, array2: Array, [sortBy]: String)
      • array1: First array
      • array2: Second array
      • [sortBy]: Property name used to sort objects in the array. Two identical arrays in different order will not be equal (default: null)
      • return: true if the value is an array
  • Converters

    • toSerialComma(array: Array)
      • array: The array to convert
      • return: A string formatted as a serial comma
  • Functions

    • shuffle(array: Array)
      • array: The array to shuffle
        • return: The shuffled array

EvoDate

  • Checkers

    • isDate(value: any)
      • value: The value to test
      • return: true if the value is a valid date
    • isMySQLDate(value: any)
      • value: The value to test
      • return: true if the value is a string with the valid MySQL date format (yyyy-mm-dd)
  • Converters

    • toDate(d: any)
      • s: The thing to convert
      • return: A date object, null/undefined if the provided value is null/undefined and NaN if it's not convertible.
    • toString(date: Date, [withTime]: Bool, [locale]: String)
      • date: The value to convert
      • [withTime]: Include time in the result (default: true)
      • [locale]: The locale used in the conversion. It may changed the returned string format (default: "fr-FR")
      • return: A date formatted like "dd/MM/yyyy [hh:mm:ss]"
    • toTimeString(date: Date, [locale]: String)
      • date: The date to convert
      • [locale]: The locale used in the conversion. It may changed the returned string format (default: "fr-FR")
      • return: A date formatted like "hh:mm:ss"
    • toFieldString(date: Date)
      • date: The value to convert
      • return: A date formatted like "yyyy-MM-dd"
    • timeStrToDate(time: String, [format]: String)
      • time: The date to convert
      • [format]: The format used for conversion (default: "hh:mm")
      • return: A date object filled with the time string provided
    • secondsToReadable(seconds: Number)
      • seconds: Seconds to convert
      • return: The converted seconds and epoch
  • Functions

    • dayDiff(start: Date, end: Date)
      • start: Start date
      • end: End date
      • return: How many days between these two dates

EvoFunctions

  • Checkers

    • isFunction(value: any)
      • value: The value to test
      • return: true if the value is a function
  • Functions

    • measurePromise(func: Function)
      • func: The function to measure
      • return: Returns an object with perf and returned data of the measured promise
      • throw: Same as return but as an Error

EvoMisc

  • Checkers

    • isDefined(value: any)
      • value: The value to test
      • return: true if the value is not undefined or null
    • isEmail(value: any)
      • value: The value to test
      • return: true if the value is a string containing a valid email address
    • isPasswordSafe(value: any|[any])
      • value: The value(s) to test
      • rules: Object with these properties:
        {
         mustContain: {
           lowerCase: true|false (default: true),
           upperCase: true|false (default: true),
           digit: true|false (default: true),
           special: true|false (default: true),
         },
         minLength: Number (default: 8)
        }
      • return: true if the value is a safe password
  • Converters

    • bytesToReadable(bytes: Number, [decimals]: Number)
      • bytes: Bytes to convert
      • [decimals]: How many decimals (default: 2)
      • return: The converted bytes size to the closest unit
  • Functions

    • padLeft(value: any, [pad]: String)
      • value: The value to pad
      • [pad]: With what to pad (default: "00")
      • return: The padded string
      • asOptions(data: Array, nameProp: String|Function, [valueProp])
        • data: The data array to transform
        • nameProp: What prop name to use for the name
        • [valueProp]: What prop name to use for the value. If null, use nameProp instead
        • return: Return the array with a name and a value prop on each item

EvoNumber

  • Checkers

    • isNumber(value: any, [parse]: Bool)
      • value: The value to test
      • [parse]: If set to true, the function will parse the value to find a integer (base 10) (default: false)
      • return: true if the value is a number
    • isFloat(value: any, [parse]: Bool)
      • value: The value to test
      • [parse]: If set to true, the function will parse the value to find a float (default: false)
      • return: true if the value is a float

EvoObject

  • Checkers

    • isDeepEqual(obj1: Object, obj2: Object)
      • obj1: First object
      • obj2: Second object
      • return: true if the two objects are deeply equal

EvoString

  • Checkers

    • isString(value: any)
      • value: The value to test
      • return: true if the value is a string
    • isEmpty(value: any)
      • value: The value to test
      • return: true if the value is a string and if its empty
    • isBlank(value: any)
      • value: The value to test
      • return: true if the value is a string and if its blank
      • isNotBlank(value: any)
        • value: The value to test
        • return: true if the value is a string and if its not blank
    • inRange(value: any|[any], [min]: Number, [max]: Number, [includeBounds]: Bool, [canBeNull]: Bool)
      • value: The value(s) to test
      • [min]: Minimum string length (default: null)
      • [max]: Maximum string length (default: null)
      • [includeBounds]: Include the min and max bounds in the range (default: true)
      • [canBeNull]: Authorize or not the string to be null or undefined (default: false)
      • return: true if the value is a string between min and max or if it's an undefined/null with canBeNull set at true

License

MIT.