Simple utils : ramdonInt, clamp, map, uuid, assert...
This package is part of quark framework but it can be used independently.
npm install quark-utils --saveimport { randomInt } from 'quark-utils/math'
import { createCanvas } from 'quark-utils/dom'
import { uuid } from 'quark-utils/common'
// Generate a ramdom number between 0 and 10
const number = randomInt(0, 10)
// Create a new 100x100 HTMLCanvasElement
const canvas = createCanvas(100, 100)
// Generate a UUID
const uuid = uuid()See https://fm-ph.github.io/quark-utils/
To build the sources with babel in ./lib directory :
npm run buildTo generate the JSDoc :
npm run docsTo generate the documentation and deploy on gh-pages branch :
npm run docs:deployTo run the tests, first clone the repository and install its dependencies :
git clone https://github.com/fm_ph/quark-utils.git
cd quark-signal
npm installThen, run the tests :
npm testTo watch (test-driven development) :
npm run test:watchFor coverage :
npm run test:coverageMIT License © Patrick Heng Fabien Motte

