4.1.5 • Published 11 months ago

common-utils-pkg v4.1.5

Weekly downloads
6
License
ISC
Repository
github
Last release
11 months ago

Common Utilities Package

A package of commonly used JavaScript utilities.

Site | Docs

Package Details

npm version node version coverage downloads

Repo Details

open issues open prs code size contributors

:tada: v4 is here

v4 is just migrating the code base to TypeScript. Kindly refer to the changelog for more info.

v3 is here

Version 3 introduces a code-breaking change. Each method is exported independently instead of having them under a "category utility". Read more on how to use it here.

Installation

NPM

npm i --save common-utils-pkg

Yarn

yarn add common-utils-pkg

Usage

ES6

// Specific methods

import { randomPastelColor } from 'common-utils-pkg';
randomPastelColor();
// All methods

import * as UTILS from 'common-utils-pkg';
UTILS.randomPastelColor();

Browser

<script src="https://unpkg.com/common-utils-pkg"></script>
<script>
  // Specific methods

  const randomPastelColor = window['common-utils-pkg].randomPastelColor;
  randomPastelColor();
</script>
<script>
  // All methods

  const UTILS = window['common-utils-pkg'];
  UTILS.randomPastelColor();
</script>

Read more about the usage here

Available Methods

Read more about the methods available here

Features

Contributing

1.Create a folder under src/ and name the folder with the same name as the method.

2.Create methodName.js and methodName.spec.js

The full directory should look like this:

src/
  methodName/
    - methodName.js
    - methodName.spec.js

3.If the method you are authoring has expected parameters then import expects

import expects from '../expects/expects';

Wrap your exported function with expects

export default expects(
  methodName,
  'methodName',
  { // required parameters
    0: 'string', // 1st parameter is required and is a string
    1: 'number', // 2nd parameter is required and is a number
  },
  { // optional parameters
    2: 'number' // 3rd parameter is optional but is a number
  }
)

Publishing

Publish to NPM

To publish version, just create a relase tag and a github workflow will automatically handle the publishing to npm.

Publish doc updates

Doc updates should be automatically be deployed once merged to main by github action.

4.1.4

11 months ago

4.1.5

11 months ago

4.1.3

1 year ago

4.1.2

1 year ago

4.0.8-alpha

3 years ago

4.1.0

3 years ago

4.1.1

3 years ago

4.0.0-alpha

3 years ago

4.0.1-alpha

3 years ago

4.0.7

3 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.1.0

6 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.9.0

7 years ago

1.8.0

7 years ago

1.7.4

7 years ago

1.7.1

7 years ago

1.7.0

7 years ago

1.6.2

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago