1.2.0 • Published 5 years ago

quark-utils v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

build status stability npm version coverage js-standard-style semantic-release

Simple utils : ramdonInt, clamp, map, uuid, assert...

This package is part of quark framework but it can be used independently.

Installation

NPM

npm install quark-utils --save

Usage

import { 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()

API

See https://fm-ph.github.io/quark-utils/

Build

To build the sources with babel in ./lib directory :

npm run build

Documentation

To generate the JSDoc :

npm run docs

To generate the documentation and deploy on gh-pages branch :

npm run docs:deploy

Testing

To 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 install

Then, run the tests :

npm test

To watch (test-driven development) :

npm run test:watch

For coverage :

npm run test:coverage

License

MIT License © Patrick Heng Fabien Motte

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

7 years ago