Skip to content

Latest commit

 

History

History
170 lines (127 loc) · 6.15 KB

File metadata and controls

170 lines (127 loc) · 6.15 KB

Common Utilities Package

A package of commonly used JavaScript utilities.

Package Details

npm version node version coverage downloads

Repo Details

open issues open prs code size contributors

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

Contributing

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

2.Create methodName.ts and methodName.test.ts

The full directory should look like this:

src/
  method-name/
    - method-name.ts
    - method-name.test.ts

Scripts

  • yarn docusaurus:generate - generate new files. Will auto refresh page
  • yarn docusaurus:start - start up the docu page

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.