Skip to content

Commit 6327f87

Browse files
committed
Update dev dependencies and documentation
1 parent ea93ec9 commit 6327f87

File tree

3 files changed

+2464
-3300
lines changed

3 files changed

+2464
-3300
lines changed

README.md

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
# js-utils
66

7-
A collection of dependency-free JavaScript utilities.
7+
This repository contains a set of simple, standalone JavaScript utility functions that I've used throughout the years in various projects. It's meant to provide useful tools that developers can easily modify and adapt for their own needs. The focus is on offering individual functions that can be changed as needed, rather than providing a full library.
88

9-
## Array
9+
The utilities are organized into packages based on their functionality. Each package contains a set of functions that are related to a specific area of development, such as arrays, strings, objects, functions, etc.
1010

11-
|Name|Description|
12-
|--------|-----------|
11+
## Table of Contents
12+
13+
### Array
14+
15+
| Name | Description |
16+
|------|-------------|
1317
|[chunk](https://github.com/georapbox/js-utils/tree/master/packages/arrays/chunk)|Creates an array of elements split into groups the length of size specified.|
1418
|[compact](https://github.com/georapbox/js-utils/tree/master/packages/arrays/compact)|Creates an array with all falsy values removed. 'false', 'null', '0', '""', 'undefined', and 'NaN' are falsy.|
1519
|[diff](https://github.com/georapbox/js-utils/tree/master/packages/arrays/diff)|Returns an array with only the unique values from the first array, by excluding all values from the second array using strict equality for comparisons.|
@@ -36,10 +40,10 @@ A collection of dependency-free JavaScript utilities.
3640
|[uniqBy](https://github.com/georapbox/js-utils/tree/master/packages/arrays/uniqBy)|Creates a dupliate free array by accepting an `iteratee` which is invoked for each element in array.|
3741
|[zip](https://github.com/georapbox/js-utils/tree/master/packages/arrays/zip)|Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.|
3842

39-
## String
43+
### String
4044

41-
|Name|Description|
42-
|--------|-----------|
45+
| Name | Description |
46+
|------|-------------|
4347
|[camelCase](https://github.com/georapbox/js-utils/tree/master/packages/strings/camelCase)|Converts a string to [camel case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles), eg `'theQuickBrownFoxJumpsOverTheLazyDog'`.|
4448
|[capitalize](https://github.com/georapbox/js-utils/tree/master/packages/strings/capitalize)|Capitalizes the first character of a string (Optionally, converts the rest of the string to lower case).|
4549
|[classnames](https://github.com/georapbox/js-utils/tree/master/packages/strings/classnames)|Creates a string by conditionally joining classNames together.|
@@ -66,20 +70,20 @@ A collection of dependency-free JavaScript utilities.
6670
|[unescapeHTML](https://github.com/georapbox/js-utils/tree/master/packages/strings/unescapeHTML)|Converts the HTML entities `&`, `<`, `>`, `"`, `&#34` and `'` in a string to their corresponding characters.|
6771
|[words](https://github.com/georapbox/js-utils/tree/master/packages/strings/words)|Splits string into an array of its words.|
6872

69-
## Object
73+
### Object
7074

71-
|Name|Description|
72-
|--------|-----------|
75+
| Name | Description |
76+
|------|-------------|
7377
|[get](https://github.com/georapbox/js-utils/tree/master/packages/objects/get)|Gets the `value` at path of `object`. If the resolved value is `undefined`, the `defaultValue` is returned in its place.|
7478
|[omit](https://github.com/georapbox/js-utils/tree/master/packages/objects/omit)|Creates an object composed of the own enumerable (not inherited) property paths of object that are not omitted.|
7579
|[pick](https://github.com/georapbox/js-utils/tree/master/packages/objects/pick)|Creates an object composed of the picked object properties.|
7680
|[pickBy](https://github.com/georapbox/js-utils/tree/master/packages/objects/pickBy)|Creates an object composed of the object enumerable properties that predicate returns truthy for.|
7781
|[trueTypeOf](https://github.com/georapbox/js-utils/tree/master/packages/objects/trueTypeOf)|Determines the true type of a value using `Object.prototype.toString.call()`.|
7882

79-
## Function
83+
### Function
8084

81-
|Name|Description|
82-
|--------|-----------|
85+
| Name | Description |
86+
|------|-------------|
8387
|[after](https://github.com/georapbox/js-utils/tree/master/packages/function/after)|Creates a function that invokes `fn` once it's called `n` or more times.|
8488
|[ary](https://github.com/georapbox/js-utils/tree/master/packages/function/ary)|Creates a function that accepts up to `n` arguments, ignoring any additional arguments.|
8589
|[before](https://github.com/georapbox/js-utils/tree/master/packages/function/before)|Creates a function that invokes `fn` while it’s called less than `n` times.|
@@ -95,10 +99,10 @@ A collection of dependency-free JavaScript utilities.
9599
|[throttle](https://github.com/georapbox/js-utils/tree/master/packages/function/throttle)|Limits the number of times a function can be called in a given period.|
96100
|[unary](https://github.com/georapbox/js-utils/tree/master/packages/function/unary)|Creates a function that accepts up to one argument, ignoring any additional arguments.|
97101

98-
## Is
102+
### Is
99103

100-
|Name|Description|
101-
|--------|-----------|
104+
| Name | Description |
105+
|------|-------------|
102106
|[isArray](https://github.com/georapbox/js-utils/tree/master/packages/is/isArray)|Checks if a value is an array.|
103107
|[isArrayLike](https://github.com/georapbox/js-utils/tree/master/packages/is/isArrayLike)|Checks if a value is array-like.|
104108
|[isArrayLikeObject](https://github.com/georapbox/js-utils/tree/master/packages/is/isArrayLikeObject)|Checks if a value is array-like and object as well.|
@@ -139,10 +143,10 @@ A collection of dependency-free JavaScript utilities.
139143
|[isWeakMap](https://github.com/georapbox/js-utils/tree/master/packages/is/isWeakMap)|Checks if a value is classified as a WeakMap object.|
140144
|[isWeakSet](https://github.com/georapbox/js-utils/tree/master/packages/is/isWeakSet)|Checks if a value is classified as a WeakSet object.|
141145

142-
## Math
146+
### Math
143147

144-
|Name|Description|
145-
|--------|-----------|
148+
| Name | Description |
149+
|------|-------------|
146150
|[average](https://github.com/georapbox/js-utils/tree/master/packages/math/average)|Calculates the average of a set of numbers.|
147151
|[clamp](https://github.com/georapbox/js-utils/tree/master/packages/math/clamp)|Clamps number within the inclusive lower and upper bounds.|
148152
|[degreesToRadians](https://github.com/georapbox/js-utils/tree/master/packages/math/degreesToRadians)|Converts degrees to radians.|
@@ -158,10 +162,10 @@ A collection of dependency-free JavaScript utilities.
158162
|[roundToNearest](https://github.com/georapbox/js-utils/tree/master/packages/math/roundToNearest)|Rounds a number to the nearest multiple of a value provided.|
159163
|[roundToPlaces](https://github.com/georapbox/js-utils/tree/master/packages/math/roundToPlaces)|Rounds a number to a number of desired places.|
160164

161-
## DOM
165+
### DOM
162166

163-
|Name|Description|
164-
|--------|-----------|
167+
| Name | Description |
168+
|------|-------------|
165169
|[convertImageToBase64](https://github.com/georapbox/js-utils/tree/master/packages/dom/convertImageToBase64)|Converts an image's content to Data URI scheme.|
166170
|[cookie](https://github.com/georapbox/js-utils/tree/master/packages/dom/cookie)|Create, read and delete cookies.|
167171
|[highResolutionCanvas](https://github.com/georapbox/js-utils/tree/master/packages/dom/highResolutionCanvas)|Processes an `HTMLCanvasElement` by downsampling on the canvas to ensure that the drawn visuals do not look blurry on high-DPI screens.|
@@ -170,24 +174,35 @@ A collection of dependency-free JavaScript utilities.
170174
|[whichAnimationEnd](https://github.com/georapbox/js-utils/tree/master/packages/dom/whichAnimationEnd)|Detects the supported property name for the "animationend" event.|
171175
|[whichTransitionEnd](https://github.com/georapbox/js-utils/tree/master/packages/dom/whichTransitionEnd)|Detects the supported property name for the "transitionend" event.|
172176

173-
## Installation
177+
## Development
178+
179+
### Installation
180+
181+
#### Clone repo
174182

175-
### Clone repo
183+
```sh
184+
git clone https://github.com/georapbox/js-utils.git
185+
```
186+
187+
#### Install dev dependencies
176188

177189
```sh
178-
$ git clone https://github.com/georapbox/js-utils.git
190+
npm install
179191
```
180192

181-
### Install dev dependencies
193+
### Test
182194

183195
```sh
184-
$ npm install
196+
npm test
197+
npm run test:watch # Run tests in watch mode
185198
```
186199

187-
## Test
200+
### Generate documentation
201+
202+
Generates markdown documentation for a single file and prints it to stdout.
188203

189204
```sh
190-
$ npm run test
205+
npm run docs <path-to-file>
191206
```
192207

193208
## License

0 commit comments

Comments
 (0)