Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

👷 🔧 zero dependencies vanilla JavaScript utils.

License

NotificationsYou must be signed in to change notification settings

fabiocaccamo/utils.js

 
 

Repository files navigation

utils.js

👷 🔧 zero dependencies vanilla JavaScript utils.

Table of contents

Installation

This library is available throughnpm:

npm install @fabiocaccamo/utils.js

Usage

CDN

<scriptsrc=" https://cdn.jsdelivr.net/npm/@fabiocaccamo/utils.js/dist/utils.min.js"></script>

Local

<scriptsrc="node_modules/@fabiocaccamo/utils.js/dist/utils.min.js"></script>

Node

varutils=require("@fabiocaccamo/utils.js");

ESM

importutilsfrom'@fabiocaccamo/utils.js';

APIs

utils.array

  • all

  • any

  • clean

  • clone

  • contains

  • equals

  • flatten

  • index

  • insert

  • max

  • min

  • paginate

  • reduce

  • remove

  • replace

  • rotate

  • shuffle

  • sort

  • sum

  • unique

  • unzip

  • zip

utils.base64

  • decode

  • encode

utils.color

  • cmykToHex

  • cmykToRgb

  • hexToCmyk

  • hexToRgb

  • rgbToCmyk

  • rgbToHex

utils.color.cmyk

  • toString

  • toStringCSS

utils.color.hex

  • average

  • distance

  • gradient

  • gradientMatrix

  • interpolateBilinear

  • interpolateLinear

  • interpolateMultilinear

  • nearest

  • toCmyk

  • toRgb

  • toString

  • toStringCSS

utils.color.rgb

  • average

  • distance

  • gradient

  • gradientMatrix

  • interpolateBilinear

  • interpolateLinear

  • interpolateMultilinear

  • nearest

  • toCmyk

  • toRgb

  • toString

  • toStringCSS

utils.date

  • clone

  • constrain

  • format

  • isFuture

  • isPast

  • max

  • min

  • parse

  • timestamp

  • today

  • tomorrow

  • yesterday

  • yyyymmdd

utils.ease

  • backIn

  • backInOut

  • backOut

  • bounceIn

  • bounceInOut

  • bounceOut

  • circularIn

  • circularInOut

  • circularOut

  • cubicIn

  • cubicInOut

  • cubicOut

  • elasticIn

  • elasticInOut

  • elasticOut

  • exponentialIn

  • exponentialInOut

  • exponentialOut

  • none

  • quadraticIn

  • quadraticInOut

  • quadraticOut

  • quarticIn

  • quarticInOut

  • quarticOut

  • quinticIn

  • quinticInOut

  • quinticOut

  • sexticIn

  • sexticInOut

  • sexticOut

  • sineIn

  • sineInOut

  • sineOut

  • waveCosine

  • waveSawtooth

  • waveSine

utils.func

  • args

  • attempt

  • bind

  • call

  • debounce

  • delay

  • memoize

  • noop

  • repeat

  • throttle

  • until

  • validate

utils.geom

utils.geom.point

  • add

  • angle

  • cross

  • distance

  • dot

  • equals

  • interpolate

  • length

  • magnitude

  • project

  • rect

  • rotate

  • scale

  • subtract

  • translate

utils.hex

  • decodeInt

  • encodeInt

utils.json

  • decode

  • encode

utils.math

  • average

  • constrain

  • cycle

  • equals

  • euclideanDistance

  • factorial

  • gcd

  • lcm

  • lerp

  • map

  • nearest

  • normalize

  • proportion

  • roundDecimals

  • roundToMultiple

  • roundToNearest

  • roundToPower

  • sign

  • summation

utils.math.interpolation

  • bilinear

  • linear

  • multilinear

  • scalar

utils.number

  • isBetween

  • isEven

  • isFloat

  • isNegative

  • isOdd

  • isPositive

  • isPrime

utils.object

  • assign

  • clean

  • clone

  • decodeBase64

  • decodeJSON

  • decodeParameters

  • encodeBase64

  • encodeJSON

  • encodeParameters

  • equals

  • is

  • keypath

  • keys

  • length

  • map

  • merge

  • search

  • values

utils.random

  • argument

  • bit

  • boolean

  • color

  • element

  • float

  • index

  • integer

  • map

  • sign

  • string

utils.string

  • contains

  • endsWith

  • icontains

  • levenshteinDistance

  • levenshteinSimilarity

  • padLeft

  • padRight

  • padZeros

  • render

  • replace

  • reverse

  • rotate

  • slugify

  • startsWith

  • toConstantCase

  • toRandomCase

  • toTitleCase

  • toUpperCaseFirst

  • trim

  • trimLeft

  • trimRight

utils.test

  • assertArray

  • assertBase64

  • assertBoolean

  • assertDate

  • assertEqual

  • assertError

  • assertFalse

  • assertFunction

  • assertJSON

  • assertNaN

  • assertNone

  • assertNotArray

  • assertNotBase64

  • assertNotBoolean

  • assertNotDate

  • assertNotEqual

  • assertNotError

  • assertNotFunction

  • assertNotJSON

  • assertNotNone

  • assertNotNull

  • assertNotNumber

  • assertNotObject

  • assertNotRegExp

  • assertNotString

  • assertNotUndefined

  • assertNull

  • assertNumber

  • assertNumberAlmostEqual

  • assertObject

  • assertRegExp

  • assertString

  • assertThrows

  • assertTrue

  • assertUndefined

utils.trigo

  • acosDeg

  • angleDeg

  • angleRad

  • asinDeg

  • atan2Deg

  • atanDeg

  • cosDeg

  • cycleDeg

  • degToRad

  • fastDeg

  • haversine

  • hypo

  • radToDeg

  • sinDeg

  • tanDeg

utils.type

  • isArray

  • isBase64

  • isBoolean

  • isDate

  • isError

  • isFunction

  • isJSON

  • isNaN

  • isNone

  • isNull

  • isNumber

  • isObject

  • isRegExp

  • isString

  • isType

  • isUndefined

  • of

utils.url

  • getDomain

  • getParameterByName

  • getParameters

  • getParametersDict

  • getParametersList

  • getParametersString

  • getURL

  • hasParameter

  • isFile

  • isHttp

  • isHttps

  • isLocalhost

utils.utf8

  • decode

  • encode

utils.xml

  • removeNamespaces

Development

Setup

  • git clone https://github.com/fabiocaccamo/utils.js.git
  • npm install

Watch

  • npm run watch

Testing

  • npm run test(run tests against dist usingGulp task runner andMocha Javascript testing framework)

Formatting

  • npm run format(format code usingPrettier code formatter, refer to.prettierrc for specific formatting options)

Build

  • npm run build

Security

Refer toSECURITY.md

License

Released underMIT License.

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp