common-utils-pkg
v4.3.0
Published
A package of commonly used JavaScript utilities.
Maintainers
Readme
Common Utilities Package
A package of commonly used JavaScript utilities.
Package Details
Repo Details
Installation
NPM
npm i --save common-utils-pkgYarn
yarn add common-utils-pkgUsage
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.tsScripts
yarn docusaurus:generate- generate new files. Will auto refresh pageyarn 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.
