fe-utils-core
v1.0.3
Published
Generic frontend utilities for Node.js and browser environments
Readme
fe-utils-core
Generic frontend utilities for Node.js projects and browser environments. Share common helpers across your frontend applications.
Features
- Debounce & throttle functions
- Object/array checks (isEmpty)
- Number clamping & formatting
- Browser storage helpers (localStorage/sessionStorage)
- Dual Node.js/browser compatible
Installation
npm install fe-utils-coreUsage
import { debounce, isEmpty, formatNumber , getPlugin } from 'fe-utils-core';
import storage from 'fe-utils-core/storage.js';
// Debounce
const debouncedSearch = debounce((query) => {
console.log('Searching:', query);
}, 300);
// Storage
storage.set('user', { name: 'John' });
const user = storage.get('user');
// Formatting
const price = formatNumber(1234.567, 2); // "1,234.57"API
debounce(func, wait)
Returns debounced version of function.
throttle(func, limit)
Returns throttled version.
isEmpty(obj)
Checks if value is empty.
clamp(num, min, max)
Clamps number between min/max.
formatNumber(num, decimals)
Formats number with Intl.
storage object
set(key, value)get(key, defaultValue)remove(key)clear()
Development
npm install
npm test
npm publish # after loginLicense
ISC
