0.0.4 • Published 8 months ago

@smarterp/components v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

About @smarterp/libs 📚

@smarterp/libs is a collection of utility functions and classes designed to simplify common tasks in web development. It includes modules for formatting dates, currency values, and more.

Installation

Install the package using npm:

npm install @smarterp/libs --save

Via Git:

git clone https://github.com/turbotechlabs/node-libs.git

Usage

Format Class

The Format class provides date formatting functionality. Read more

import { Format } from '@smarterp/libs';

const dateString = '2023-05-15';
const formattedDate = Format.date(dateString);
console.log(formattedDate); // Output: May 15, 2023

Currency Class

The Currency class offers methods for formatting currency values. Read more

import { Currency } from '@smarterp/libs';

console.log(Currency.format(123.456)); // Output: "123.46"
console.log(Currency.formatWithComma(1234567.89)); // Output: "1,234,567.89"

Merge Class

The Merge class is used to merge objects with URL search parameters. Read more

import { Merge } from '@smarterp/libs';

const options = { a: '1', b: '2' };
const searchParams = new URLSearchParams('b=3&c=4');
const result = Merge.object(options, searchParams);
console.log(result); // Output: { a: '1', b: '3', c: '4' }

Thumbnail Class

The Thumbnail class generates HTML for thumbnail images. Read more

import { Thumbnail } from '@smarterp/libs';

const thumbnailHtml = Thumbnail.list({
  url: 'https://example.com/image.jpg',
  alt: 'Example image'
});
console.log(thumbnailHtml);
0.0.4

8 months ago