A package of commonly used JavaScript utilities.
NPM
npm i --save common-utils-pkg
Yarn
yarn add common-utils-pkg
// Specific methods
import { randomPastelColor } from 'common-utils-pkg';
randomPastelColor();
// All methods
import * as UTILS from 'common-utils-pkg';
UTILS.randomPastelColor();
<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
Read more about the methods available here
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
yarn docusaurus:generate- generate new files. Will auto refresh pageyarn docusaurus:start- start up the docu page
To publish version, just create a relase tag and a github workflow will automatically handle the publishing to npm.
Doc updates should be automatically be deployed once merged to main by github action.
