@muffin-dev/js-helpers

Provides helpers and utilities for vanilla JavaScript. Usable in browsers.

Usage no npm install needed!

<script type="module">
  import muffinDevJsHelpers from 'https://cdn.skypack.dev/@muffin-dev/js-helpers';
</script>

README

Muffin Dev for Node - JS Helpers

This module contains a set of utilities for JavaScript.

Installation

In browser

Just download the js-helpers.min.js file, and import it in your we pages:

<script src="js-helpers.min.js"></script>

With Node JS

Install it locally with NPM by using the following command:

npm i @muffin-dev/js-helpers

Usage

In browser

Import the library in your web page with the <script> tag, and use the JSHelpers global variable to use the library:

<script src="js-helpers.min.js"></script>
<script>
    // Will log "00127" in your browser console
    console.log(JSHelpers.leading0(127, 5));
</script>

With Node JS

const JSHelpers = require('@muffin-dev/js-helpers');
// OR, if you need only a specific method
// const leading0 = require('@muffin-dev/js-helpers').leading0;

// Will log "00127" in your terminal
console.log(JSHelpers.leading0(127, 5));

Documentation

Tools

Helpers