open-index/open-npm huggingface dataset:
npm package: @satyajit_me/api-mock-generator
Description: Generate realistic mock data for APIs from schema definitions
Author: Satyajit
Latest version: 1.0.1

# API Mock Generator

Generate realistic mock data for APIs from schema definitions.

## Installation

```bash
npm install api-mock-generator
```

## Usage

```javascript
import { fullName, email, uuid, generate, generateMany } from 'api-mock-generator';
```

## API

### Identity

```javascript
uuid()          // 'a1b2c3d4-e5f6-4g7h-8i9j-k0l1m2n3o4p5'
firstName()     // 'John'
lastName()      // 'Smith'
fullName()      // 'John Smith'
username()      // 'cool_john123'
password(12)    // 'Kj#8mP$2qL@9'
```

### Contact

```javascript
email()              // 'john.smith42@gmail.com'
email('Jane Doe')    // 'jane.doe17@outlook.com'
phone()              // '(555) 123-4567'
phone('###-###-####') // '555-123-4567'
```

### Address

```javascript
address()       // { street, city, country, zipCode }
streetAddress() // '1234 Main St'
city()          // 'New York'
country()       // 'United States'
zipCode()       // '12345'
```

### Company

```javascript
company()  // 'Acme Corp'
```

### Dates

```javascript
date()                    // Random date
date({ from, to })        // Date in range
pastDate(2)               // Within last 2 years
futureDate(1)             // Within next year
```

### Numbers

```javascript
integer(1, 100)           // 42
float(0, 10, 2)           // 3.14
boolean()                 // true or false
boolean(0.8)              // 80% chance true
```

### Text

```javascript
lorem(10)       // 10 words of lorem ipsum
paragraph(3)    // 3 sentences
```

### Web

```javascript
url()                    // 'https://example.com/about'
imageUrl(400, 300)       // Placeholder image URL
avatarUrl('John')        // Avatar URL
color()                  // '#ff5733'
ipAddress()              // '192.168.1.100'
creditCard()             // '4111111111111111'
```

### Utilities

```javascript
pick(['a', 'b', 'c'])         // Random element
pickMultiple(['a','b','c'], 2) // N random elements
```

### Schema Generation

```javascript
// Generate single object from schema
const user = generate({
  id: uuid,
  name: fullName,
  email: email,
  age: () => integer(18, 65)
});

// Generate array of objects
const users = generateMany({
  id: uuid,
  name: fullName
}, 100);
```

## License

MIT
npm package: @satyajit_me/cache-manager
Description: In-memory caching with TTL support, LRU eviction, and statistics
Author: Satyajit
Latest version: 1.0.1

# Cache Manager

In-memory caching with TTL support, LRU eviction, and statistics.

## Installation

```bash
npm install cache-manager
```

## Quick Start

```javascript
import { Cache, LRUCache, memoize } from 'cache-manager';

const cache = new Cache({ maxSize: 100, defaultTTL: 60000 });
cache.set('user:123', userData);
cache.get('user:123');
```

## API

### Cache

```javascript
const cache = new Cache({
  maxSize: 1000,         // Max entries (Infinity)
  defaultTTL: 60000,     // Default TTL in ms (0 = no expiry)
  checkInterval: 60000   // Cleanup interval
});

cache.set('key', value)           // Set value
cache.set('key', value, 5000)     // Set with custom TTL
cache.get('key')                   // Get value
cache.has('key')                   // Check existence
cache.delete('key')                // Delete entry
cache.clear()                      // Clear all
cache.size()                       // Get count
cache.keys()                       // Get all keys
cache.values()                     // Get all values
cache.ttl('key')                   // Get remaining TTL

// Async get-or-set
const value = await cache.getOrSet('key', async () => {
  return await fetchData();
}, 5000);

// Statistics
cache.getStats()  // { hits, misses, sets, deletes, size, hitRate }
cache.resetStats()
```

### LRUCache

Least Recently Used cache with automatic eviction:

```javascript
const cache = new LRUCache(100);  // Max 100 entries

cache.set('key', value)
cache.get('key')  // Moves to most recent
```

### memoize()

Cache function results:

```javascript
const expensive = memoize((x, y) => {
  // expensive computation
  return x + y;
}, { maxSize: 100, defaultTTL: 60000 });

expensive(1, 2);  // Computes
expensive(1, 2);  // Returns cached

expensive.clear();  // Clear memo cache
```

### Namespaced Cache

```javascript
const userCache = createNamespacedCache('users', { defaultTTL: 60000 });
userCache.set('123', userData);  // Stored as 'users:123'
userCache.get('123');
userCache.clear();  // Only clears 'users:*'
```

## License

MIT
npm package: @satyajit_me/changelog-generator
Description: Parse conventional commits and generate markdown changelogs
Author: Satyajit
Latest version: 1.0.1

# Changelog Generator

Parse conventional commits and generate markdown changelogs.

## Installation

```bash
npm install changelog-generator
```

## Usage

```javascript
import { generate, parseCommit, bumpVersion } from 'changelog-generator';
```

## API

### Generate Changelog

```javascript
// Generate from git history
const changelog = generate({
  from: 'v1.0.0',    // Starting tag (optional)
  to: 'HEAD',         // Ending ref
  version: '1.1.0',   // Version for header
  repoUrl: 'https://github.com/user/repo'
});
```

### Parse Commits

```javascript
parseCommit('feat(api): add endpoint')
// { type: 'feat', scope: 'api', breaking: false, description: 'add endpoint' }

parseCommit('feat!: breaking change')
// { type: 'feat', scope: null, breaking: true, description: 'breaking change' }
```

### Validate Commits

```javascript
validateCommit('feat: valid message')
// { valid: true, parsed: { ... } }

validateCommit('invalid')
// { valid: false, error: 'Commit does not follow conventional commit format' }
```

### Version Bumping

```javascript
const commits = [
  { subject: 'feat!: breaking' }  // -> major
  { subject: 'feat: feature' }    // -> minor
  { subject: 'fix: bug' }         // -> patch
];

bumpVersion('1.2.3', commits)  // Returns new version
```

### Commit Types

| Type | Description |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `perf` | Performance improvement |
| `refactor` | Code refactoring |
| `docs` | Documentation |
| `style` | Formatting changes |
| `test` | Tests |
| `build` | Build system |
| `ci` | CI/CD |
| `chore` | Maintenance |
| `revert` | Revert commit |

### Output Format

```markdown
## [1.1.0] - 2024-01-15

### ⚠️ BREAKING CHANGES

- Major API change

### ✨ Features

- **api:** Add new endpoint
- Add user authentication

### 🐛 Bug Fixes

- **core:** Fix memory leak
```

## License

MIT
npm package: @satyajit_me/config-loader
Description: Load and validate configuration from .env, JSON, and YAML files
Author: Satyajit
Latest version: 1.0.1
Deprecated: This package has moved to @satya-js/config-loader. Please install @satya-js/config-loader instead.

# Config Loader

Load and validate configuration from `.env`, JSON, and YAML files.

## Installation

```bash
npm install config-loader
```

## Usage

```javascript
import { load, loadEnv, validate, get } from 'config-loader';

// Auto-detect format from extension
const config = load('config.json');

// Load specific formats
const env = loadEnv('.env');
const json = loadJson('config.json');
const yaml = loadYaml('config.yaml');
```

## API

### Loading Configurations

```javascript
// Load .env file
loadEnv('.env')
// { DATABASE_URL: 'postgres://...', PORT: '3000' }

// Load JSON file
loadJson('config.json')
// { database: { host: 'localhost' } }

// Load YAML file
loadYaml('config.yaml')
// { server: { port: 8080 } }

// Auto-detect format
load('config.json')  // Uses extension to detect
```

### Schema Validation

```javascript
const schema = {
  port: { required: true, type: 'number', min: 1, max: 65535 },
  env: { type: 'string', enum: ['dev', 'prod'], default: 'dev' },
  name: { required: true, type: 'string', pattern: '^[a-z]+$' }
};

const config = validate(rawConfig, schema);
// Throws if validation fails
```

**Schema Options:**
- `required` - Field must be present
- `type` - Expected type (`string`, `number`, `boolean`, `array`, `object`)
- `default` - Default value if missing
- `enum` - Allowed values
- `min/max` - For numbers
- `pattern` - Regex pattern for strings

### Utilities

```javascript
// Deep merge configs
merge(defaults, overrides)

// Get nested value
get(config, 'database.host', 'localhost')

// Set nested value (returns new object)
set(config, 'database.port', 5432)
```

## Environment-specific Config

```javascript
const base = load('config.json');
const env = load(`config.${process.env.NODE_ENV}.json`);
const config = merge(base, env);
```

## License

MIT
npm package: @satyajit_me/console-styler
Description: Beautiful console output with colors, tables, progress bars, and spinners
Author: Satyajit
Latest version: 1.0.1

# Console Styler

Beautiful console output with colors, tables, progress bars, and spinners.

## Installation

```bash
npm install console-styler
```

## Usage

```javascript
import { red, green, bold, success, table, Spinner } from 'console-styler';
```

## API

### Colors

```javascript
red('Error message')
green('Success!')
yellow('Warning')
blue('Info')
magenta('Special')
cyan('Highlight')
gray('Muted')

// Custom color
color('text', 'brightBlue')
```

### Styles

```javascript
bold('Bold text')
dim('Dimmed text')
italic('Italic text')
underline('Underlined text')
```

### Status Messages

```javascript
success('Operation completed')  // ✓ green
error('Something failed')       // ✗ red
warning('Be careful')           // ⚠ yellow
info('FYI')                     // ℹ blue
```

### Tables

```javascript
const data = [
  { name: 'John', age: 30, city: 'NYC' },
  { name: 'Jane', age: 25, city: 'LA' }
];

printTable(data);
// ┌────────┬─────┬──────┐
// │ name   │ age │ city │
// ├────────┼─────┼──────┤
// │ John   │ 30  │ NYC  │
// │ Jane   │ 25  │ LA   │
// └────────┴─────┴──────┘
```

### Progress Bar

```javascript
progressBar(50, 100)
// [████████████████████░░░░░░░░░░░░░░░░░░░░] 50%

progressBar(75, 100, { width: 20, showPercent: false })
// [███████████████░░░░░]
```

### Spinner

```javascript
const spinner = new Spinner({ message: 'Loading...' });
spinner.start();

// After operation
spinner.succeed('Done!');
// or
spinner.fail('Failed');
```

### Boxes

```javascript
printBox('Hello World!', { title: 'Message', borderColor: 'cyan' });
// ╭─── Message ───╮
// │               │
// │ Hello World!  │
// │               │
// ╰───────────────╯
```

### Dividers

```javascript
printDivider()       // ──────────────────────────────────────────────────
printDivider('═', 30, 'blue')
```

## License

MIT
npm package: @satyajit_me/csv-excel-parser
Description: Read and write CSV files with streaming support for large files
Author: Satyajit
Latest version: 1.0.1

# CSV Excel Parser

Read and write CSV files with streaming support for large files.

## Installation

```bash
npm install csv-excel-parser
```

## Quick Start

```javascript
import { parseCSV, toCSV, readCSV, writeCSV } from 'csv-excel-parser';

// Parse CSV string
const data = parseCSV(`name,age
John,30
Jane,25`);
// [{ name: 'John', age: '30' }, { name: 'Jane', age: '25' }]

// Convert to CSV
const csv = toCSV([{ name: 'John', age: 30 }]);
// 'name,age\nJohn,30'

// Read/write files
const fileData = readCSV('./data.csv');
writeCSV('./output.csv', data);
```

## API

### parseCSV(string, options)

```javascript
parseCSV(csvString, {
  delimiter: ',',      // Column delimiter
  hasHeaders: true,    // First row is headers
  headers: null,       // Custom headers array
  skipEmpty: true,     // Skip empty lines
  trim: true           // Trim values
});
```

### toCSV(data, options)

```javascript
toCSV(data, {
  delimiter: ',',
  includeHeaders: true,
  headers: null,        // Specify column order
  quotes: 'auto'        // 'auto', 'always', 'never'
});
```

### Stream Large Files

```javascript
import { streamCSV } from 'csv-excel-parser';

for await (const row of streamCSV('./large-file.csv')) {
  console.log(row);  // Process row by row
}
```

### Data Manipulation

```javascript
// Filter rows
filterCSV(data, row => row.age > 25)

// Select columns
selectColumns(data, ['name', 'email'])

// Rename columns
renameColumns(data, { name: 'fullName', age: 'years' })

// Get column names
getColumns(csvString)  // ['name', 'age', ...]
```

### File Operations

```javascript
readCSV('./data.csv', options)
writeCSV('./output.csv', data, options)
```

## License

MIT
npm package: @satyajit_me/date-toolkit
Description: Lightweight date formatting, relative time, and timezone utilities
Author: Satyajit
Latest version: 1.0.1
Deprecated: This package has moved to @satya-js/date-toolkit. Please install @satya-js/date-toolkit instead.

# Date Toolkit

Lightweight date formatting, relative time, and timezone utilities with zero dependencies.

## Installation

```bash
npm install date-toolkit
```

## Usage

```javascript
import { format, relative, add } from 'date-toolkit';

format(new Date(), 'YYYY-MM-DD')    // '2024-01-15'
relative(hourAgo)                    // '1 hour ago'
add(date, 5, 'days')                 // New date 5 days later
```

## API

### Formatting

```javascript
format(date, 'YYYY-MM-DD')     // '2024-01-15'
format(date, 'DD/MM/YYYY')     // '15/01/2024'
format(date, 'HH:mm:ss')       // '14:30:45'
format(date, 'hh:mm A')        // '02:30 PM'
```

**Format Tokens:**
| Token | Output | Description |
|-------|--------|-------------|
| YYYY | 2024 | 4-digit year |
| YY | 24 | 2-digit year |
| MM | 01-12 | Month (padded) |
| DD | 01-31 | Day (padded) |
| HH | 00-23 | Hour 24h (padded) |
| hh | 01-12 | Hour 12h (padded) |
| mm | 00-59 | Minutes (padded) |
| ss | 00-59 | Seconds (padded) |
| A/a | AM/PM | Meridiem |

### Relative Time

```javascript
relative(oneHourAgo)      // '1 hour ago'
relative(twoDaysAgo)      // '2 days ago'
relative(futureDate)      // 'in 3 hours'
```

### Date Math

```javascript
add(date, 5, 'days')       // Add 5 days
subtract(date, 2, 'hours') // Subtract 2 hours
diff(date1, date2, 'days') // Difference in days
```

### Date Checks

```javascript
isToday(date)      // true/false
isYesterday(date)  // true/false
isTomorrow(date)   // true/false
isValid(date)      // true/false
```

### Range Helpers

```javascript
startOf(date, 'day')    // Start of day (00:00:00)
startOf(date, 'month')  // First day of month
endOf(date, 'day')      // End of day (23:59:59)
endOf(date, 'year')     // Last day of year
```

## License

MIT
npm package: @satyajit_me/deep-object-utils
Description: Deep merge, clone, diff, and path-based access for nested objects
Author: Satyajit
Latest version: 1.0.1

# Deep Object Utils

Deep merge, clone, diff, and path-based access for nested objects.

## Installation

```bash
npm install deep-object-utils
```

## Usage

```javascript
import { deepMerge, get, set, flatten } from 'deep-object-utils';
```

## API

### Cloning & Merging

```javascript
// Deep clone
deepClone({ a: { b: 1 } })

// Deep merge (returns new object)
deepMerge({ a: 1 }, { b: 2 }, { c: 3 })
// { a: 1, b: 2, c: 3 }
```

### Path-based Access

```javascript
const obj = { user: { profile: { name: 'John' } } };

// Get nested value
get(obj, 'user.profile.name')          // 'John'
get(obj, 'user.missing', 'default')    // 'default'

// Set nested value (returns new object)
set(obj, 'user.profile.age', 30)

// Check if path exists
has(obj, 'user.profile.name')  // true

// Delete at path
unset(obj, 'user.profile.name')

// Array notation works too
get({ arr: [1, 2, 3] }, 'arr[1]')  // 2
```

### Flatten & Unflatten

```javascript
// Flatten nested object
flatten({ a: { b: { c: 1 } } })
// { 'a.b.c': 1 }

// Unflatten to nested
unflatten({ 'a.b.c': 1 })
// { a: { b: { c: 1 } } }
```

### Comparison

```javascript
// Get differences
diff({ a: 1, b: 2 }, { a: 1, c: 3 })
// { added: { c: 3 }, removed: { b: 2 }, changed: {} }

// Deep equality check
isEqual({ a: { b: 1 } }, { a: { b: 1 } })  // true
```

### Pick & Omit

```javascript
pick({ a: 1, b: 2, c: 3 }, ['a', 'c'])  // { a: 1, c: 3 }
omit({ a: 1, b: 2, c: 3 }, ['b'])       // { a: 1, c: 3 }
```

## License

MIT
npm package: @satyajit_me/dependency-analyzer
Description: Analyze package.json dependencies, find unused packages, and visualize dependency trees
Author: Satyajit
Latest version: 1.0.1

# Dependency Analyzer

Analyze package.json dependencies, find unused packages, and visualize dependency trees.

## Installation

```bash
npm install dependency-analyzer
```

## Usage

```javascript
import { analyze, findUnused, generateTree } from 'dependency-analyzer';
```

## API

### Quick Analysis

```javascript
const report = analyze('./my-project');

console.log(report.stats);     // Dependency counts
console.log(report.unused);    // Unused packages
console.log(report.issues);    // Potential problems
console.log(report.tree);      // ASCII tree
```

### Get Dependencies

```javascript
const deps = getDependencies('./my-project');

deps.dependencies       // Production deps
deps.devDependencies    // Dev deps
deps.peerDependencies   // Peer deps
deps.all                // All combined
```

### Find Unused Dependencies

```javascript
const unused = findUnused('./my-project');

console.log(unused.unused);      // ['lodash', 'moment']
console.log(unused.used);        // ['express', 'react']
console.log(unused.unusedCount); // 2
```

### Get Statistics

```javascript
const stats = getStats('./my-project');
// {
//   dependencies: 15,
//   devDependencies: 8,
//   peerDependencies: 2,
//   optionalDependencies: 0,
//   total: 25
// }
```

### Generate Tree

```javascript
console.log(generateTree('./my-project'));
// my-app@1.0.0
// ├── express@^4.18.0
// ├── react@^18.0.0
// └── jest@^29.0.0 (dev)
```

### Check for Issues

```javascript
const issues = checkIssues('./my-project');
// [
//   { type: 'error', package: 'foo', message: 'Uses unpinned version' },
//   { type: 'info', package: 'bar', message: 'Uses pre-1.0 version' }
// ]
```

## License

MIT
npm package: @satyajit_me/file-watcher
Description: Watch files and directories for changes with debouncing and filtering
Author: Satyajit
Latest version: 1.0.1

# File Watcher

Watch files and directories for changes with debouncing and filtering.

## Installation

```bash
npm install file-watcher
```

## Quick Start

```javascript
import { watch, Watcher } from 'file-watcher';

// Simple usage
const watcher = watch('./src');
watcher.onChange(event => {
  console.log('Changed:', event.path);
});

// Stop watching
watcher.stop();
```

## API

### watch(paths, options)

```javascript
const watcher = watch('./src', {
  recursive: true,      // Watch subdirectories
  debounce: 100,        // Debounce ms
  ignore: ['node_modules', /\.git/],
  extensions: ['.js', '.ts']
});
```

### Watcher Class

```javascript
const watcher = new Watcher(['./src', './lib'], options);

watcher
  .onChange(event => console.log('Changed:', event.path))
  .onDelete(event => console.log('Deleted:', event.path))
  .onError(err => console.error(err))
  .start();

// Later
watcher.stop();
```

### Events

```javascript
watcher.on('change', event => {});  // Any change
watcher.on('rename', event => {});  // File added/renamed
watcher.on('delete', event => {});  // File deleted
watcher.on('ready', () => {});      // Watcher started
watcher.on('close', () => {});      // Watcher stopped
watcher.on('error', err => {});     // Error occurred
```

### Event Object

```javascript
{
  type: 'rename' | 'change',
  path: '/full/path/to/file.js',
  filename: 'file.js',
  timestamp: Date,
  isDirectory: boolean,
  size: number,
  mtime: Date,
  deleted: boolean
}
```

### getAllFiles(dir, options)

Scan directory for initial file list.

```javascript
import { getAllFiles } from 'file-watcher';

const files = getAllFiles('./src', {
  recursive: true,
  extensions: ['.js'],
  ignore: ['node_modules']
});
```

## Options

| Option | Default | Description |
|--------|---------|-------------|
| `recursive` | `true` | Watch subdirectories |
| `debounce` | `100` | Debounce delay in ms |
| `ignore` | `[]` | Patterns to ignore (string, RegExp, or function) |
| `extensions` | `[]` | File extensions to include (empty = all) |

## License

MIT
npm package: @satyajit_me/image-metadata-extractor
Description: Extract EXIF data, dimensions, and format info from images
Author: Satyajit
Latest version: 1.0.1
Deprecated: This package has moved to @satya-js/image-metadata-extractor. Please install @satya-js/image-metadata-extractor instead.

# Image Metadata Extractor

Extract EXIF data, dimensions, and format info from images.

## Installation

```bash
npm install image-metadata-extractor
```

## Quick Start

```javascript
import { getMetadata } from 'image-metadata-extractor';

const metadata = getMetadata('./photo.jpg');
// {
//   format: 'jpeg',
//   mimeType: 'image/jpeg',
//   width: 1920,
//   height: 1080,
//   aspectRatio: '16:9',
//   fileSize: 245760,
//   fileSizeHuman: '240 KB',
//   exif: { make: 'Canon', model: 'EOS 5D', ... }
// }
```

## API

### getMetadata(input)
Complete metadata extraction from file path or buffer.

```javascript
getMetadata('./image.png')
getMetadata(imageBuffer)
```

### detectFormat(buffer)
Detect image format from buffer.

```javascript
detectFormat(buffer)
// { format: 'jpeg', mime: 'image/jpeg', ext: 'jpg' }
```

**Supported formats:** JPEG, PNG, GIF, WebP, BMP, ICO, TIFF

### getDimensions(buffer)
Get image width and height.

```javascript
getDimensions(buffer)  // { width: 1920, height: 1080 }
```

### getExif(buffer)
Extract EXIF data from JPEG images.

```javascript
getExif(jpegBuffer)
// { make: 'Canon', model: 'EOS 5D Mark IV', dateTime: '2024:01:15 14:30:00', ... }
```

### getAspectRatio(width, height)
Calculate aspect ratio.

```javascript
getAspectRatio(1920, 1080)  // '16:9'
getAspectRatio(800, 600)    // '4:3'
```

### isImage(buffer)
Check if buffer is a valid image.

```javascript
isImage(buffer)  // true/false
```

### getOrientation(exif)
Get human-readable orientation from EXIF.

## License

MIT
npm package: @satyajit_me/input-validator
Description: Validate emails, URLs, phone numbers, credit cards with chainable rules
Author: Satyajit
Latest version: 1.0.1

# Input Validator

Validate emails, URLs, phone numbers, credit cards with chainable rules.

## Installation

```bash
npm install input-validator
```

## Usage

```javascript
import { isEmail, isUrl, validate } from 'input-validator';
```

## Quick Validators

```javascript
isEmail('test@example.com')     // true
isUrl('https://example.com')    // true
isPhone('+1 555 123-4567')      // true
isCreditCard('4111111111111111') // true
isUuid('550e8400-...')          // true
isIp('192.168.1.1')             // true
isHexColor('#ff5733')           // true
isDateString('2024-01-15')      // true
isSlug('hello-world')           // true
isJson('{"key": "value"}')      // true
isEmpty('')                      // true
isAlphanumeric('abc123')        // true
isAlpha('abc')                  // true
isNumeric('123')                // true
isInteger(42)                   // true
isInRange(5, { min: 1, max: 10 }) // true
isLength('hi', { min: 1, max: 5 }) // true
isOneOf('a', ['a', 'b', 'c'])   // true
matches('abc', /^[a-z]+$/)      // true
```

## Chainable Validation

```javascript
const result = validate(userInput)
  .required('Email is required')
  .email('Invalid email format')
  .minLength(5, 'Too short');

if (result.isValid()) {
  // proceed
} else {
  console.log(result.getErrors());     // All error messages
  console.log(result.getFirstError()); // First error only
}
```

## Chain Methods

| Method | Description |
|--------|-------------|
| `.required(msg)` | Field must not be empty |
| `.email(msg)` | Must be valid email |
| `.url(msg)` | Must be valid URL |
| `.phone(msg)` | Must be valid phone |
| `.minLength(n, msg)` | Minimum length |
| `.maxLength(n, msg)` | Maximum length |
| `.pattern(regex, msg)` | Match regex |
| `.custom(fn, msg)` | Custom validation function |

## Options

```javascript
// URL with protocol required
isUrl('example.com', { requireProtocol: true })  // false

// Length range
isLength('hello', { min: 3, max: 10 })  // true

// Number range
isInRange(5, { min: 1, max: 10 })  // true
```

## License

MIT
npm package: @satyajit_me/password-strength-checker
Description: Analyze password strength with scoring, requirements check, and feedback
Author: Satyajit
Latest version: 1.0.1

# Password Strength Checker

Analyze password strength with scoring, requirements check, and actionable feedback.

## Installation

```bash
npm install password-strength-checker
```

## Quick Start

```javascript
import { analyze, getScore, getFeedback } from 'password-strength-checker';

const result = analyze('MyP@ssw0rd');
console.log(result.score);    // 75
console.log(result.strength); // 'strong'
console.log(result.feedback); // ['Consider using 12+ characters...']
```

## API

### Quick Score

```javascript
getScore('password')    // 15 (very weak)
getScore('Str0ng!Pass') // 80 (very strong)

getStrengthLevel(85)    // 'very-strong'
getStrengthLevel(65)    // 'strong'
getStrengthLevel(45)    // 'medium'
getStrengthLevel(25)    // 'weak'
getStrengthLevel(10)    // 'very-weak'
```

### Character Checks

```javascript
hasLowercase('abc')     // true
hasUppercase('ABC')     // true
hasNumbers('123')       // true
hasSpecialChars('!@#')  // true
isCommonPassword('password')  // true
hasSequential('abc123') // true
hasRepeated('aaa')      // true
```

### Entropy Calculation

```javascript
calculateEntropy('password')  // ~38 bits
calculateEntropy('Str0ng!Pass123') // ~72 bits
```

### Requirements Check

```javascript
const result = checkRequirements('MyPass1!', {
  minLength: 8,
  requireUppercase: true,
  requireNumbers: true,
  requireSpecialChars: true
});

// { minLength: { passed: true, message: 'At least 8 characters' }, ... }
```

### Feedback

```javascript
getFeedback('weak')
// ['Use at least 8 characters', 'Add uppercase letters', ...]

getFeedback('Str0ng!Password123')
// ['Great password!']
```

### Full Analysis

```javascript
const analysis = analyze('Test123!');
// {
//   score: 65,
//   strength: 'strong',
//   entropy: 52,
//   feedback: [...],
//   requirements: { ... },
//   checks: { hasLowercase: true, ... }
// }
```

## License

MIT
npm package: @satyajit_me/rate-limiter
Description: Simple rate limiting with token bucket and sliding window algorithms
Author: Satyajit
Latest version: 1.0.1

# Rate Limiter

Simple rate limiting with token bucket and sliding window algorithms.

## Installation

```bash
npm install rate-limiter
```

## Quick Start

```javascript
import { createLimiter, KeyedRateLimiter } from 'rate-limiter';

// Simple limiter
const limiter = createLimiter({ limit: 100, windowMs: 60000 });

if (limiter.consume()) {
  // Process request
} else {
  // Rate limited
}

// Per-user limiting
const userLimiter = new KeyedRateLimiter({ limit: 10, windowMs: 60000 });
userLimiter.consume(userId);
```

## Algorithms

### Token Bucket
Allows bursting up to capacity, then refills over time.

```javascript
const limiter = new TokenBucket({
  capacity: 10,         // Maximum tokens
  refillRate: 1,        // Tokens added per interval
  refillInterval: 1000  // Refill interval (ms)
});
```

### Fixed Window
Limits requests per fixed time window.

```javascript
const limiter = new FixedWindow({
  limit: 100,       // Requests per window
  windowMs: 60000   // Window duration (ms)
});
```

### Sliding Window
More accurate rate limiting using sliding windows.

```javascript
const limiter = new SlidingWindow({
  limit: 100,
  windowMs: 60000
});
```

## API

### Common Methods

```javascript
limiter.consume()   // Try to consume, returns boolean
limiter.check()     // Check without consuming
limiter.remaining() // Get remaining requests
limiter.reset()     // Reset the limiter
```

### KeyedRateLimiter

For per-user/IP rate limiting:

```javascript
const limiter = new KeyedRateLimiter({
  limit: 10,
  windowMs: 60000,
  algorithm: 'sliding'  // 'sliding', 'fixed', 'token'
});

limiter.consume('user123')
limiter.check('user123')
limiter.remaining('user123')
limiter.reset('user123')
limiter.clear()  // Clear all
```

### createLimiter(options)

Factory function:

```javascript
createLimiter({ algorithm: 'sliding', limit: 100 })
createLimiter({ algorithm: 'token', capacity: 10 })
createLimiter({ algorithm: 'fixed', limit: 100 })
```

## License

MIT
npm package: @satyajit_me/retry-handler
Description: Automatic retry logic with exponential backoff and configurable strategies
Author: Satyajit
Latest version: 1.0.1

# Retry Handler

Automatic retry logic with exponential backoff and configurable strategies.

## Installation

```bash
npm install retry-handler
```

## Quick Start

```javascript
import { retry, withRetry } from 'retry-handler';

// Retry an async function
const result = await retry(async () => {
  return await fetchData();
});

// Wrap a function with retry logic
const fetchWithRetry = withRetry(fetchData, { maxRetries: 5 });
await fetchWithRetry();
```

## API

### retry(fn, options)

```javascript
await retry(async (attempt) => {
  console.log(`Attempt ${attempt + 1}`);
  return await apiCall();
}, {
  maxRetries: 3,           // Number of retries
  baseDelay: 1000,         // Initial delay (ms)
  maxDelay: 30000,         // Maximum delay (ms)
  factor: 2,               // Exponential factor
  jitter: true,            // Add randomization
  jitterFactor: 0.2,       // Jitter amount (±20%)
  timeout: 5000,           // Per-attempt timeout
  shouldRetry: (err) => true,  // Retry condition
  onRetry: (err, attempt, delay) => {}  // Hook
});
```

### Backoff Strategies

```javascript
// Exponential (default)
retry(fn, { factor: 2 })  // 1s, 2s, 4s, 8s...

// Linear
retryLinear(fn, { delay: 1000 })  // 1s, 2s, 3s, 4s...

// Fixed (no backoff)
retryFixed(fn, { delay: 1000 })  // 1s, 1s, 1s...
```

### withRetry(fn, options)

Create a retryable version of any function:

```javascript
const robustFetch = withRetry(fetch, { maxRetries: 3 });
await robustFetch('/api/data');
```

### Retry Conditions

```javascript
import { retryConditions } from 'retry-handler';

// Retry on network errors
retry(fn, { shouldRetry: retryConditions.networkError });

// Retry on specific HTTP status codes
retry(fn, { shouldRetry: retryConditions.httpStatus([500, 502, 503]) });

// Always/never retry
retry(fn, { shouldRetry: retryConditions.always });
retry(fn, { shouldRetry: retryConditions.never });
```

### RetryableOperation

For more control:

```javascript
const op = new RetryableOperation(fn, options);

try {
  await op.execute();
} catch (error) {
  console.log('Failed after', op.getAttempts(), 'retries');
  console.log('Errors:', op.getErrors());
}

// Abort in-progress operation
op.abort();
```

## License

MIT
npm package: @satyajit_me/string-formatter
Description: Advanced string manipulation utilities - slugify, camelCase, truncate, and more
Author: Satyajit
Latest version: 1.0.1
Deprecated: This package has moved to @satya-js/string-formatter. Please install @satya-js/string-formatter instead.

# String Formatter

Advanced string manipulation utilities for JavaScript.

## Installation

```bash
npm install string-formatter
```

## Usage

```javascript
import { slugify, camelCase, truncate } from 'string-formatter';

// Or import all functions
import stringFormatter from 'string-formatter';
```

## API

### Case Conversion

```javascript
slugify('Hello World')      // 'hello-world'
camelCase('hello world')    // 'helloWorld'
pascalCase('hello world')   // 'HelloWorld'
snakeCase('helloWorld')     // 'hello_world'
kebabCase('hello world')    // 'hello-world'
```

### Text Formatting

```javascript
capitalize('hello')         // 'Hello'
titleCase('hello world')    // 'Hello World'
truncate('Long text...', 8) // 'Long...'
reverse('hello')            // 'olleh'
```

### String Analysis

```javascript
wordCount('hello world')    // 2
charCount('hello', true)    // 5 (excludeSpaces: true)
isEmpty('   ')              // true
```

### String Manipulation

```javascript
removeExtraSpaces('  hi   there  ')  // 'hi there'
pad('hi', 5, '-', 'left')            // '---hi'
```

## Functions

| Function | Description |
|----------|-------------|
| `slugify(str)` | Convert to URL-friendly slug |
| `camelCase(str)` | Convert to camelCase |
| `pascalCase(str)` | Convert to PascalCase |
| `snakeCase(str)` | Convert to snake_case |
| `kebabCase(str)` | Convert to kebab-case |
| `truncate(str, len, suffix)` | Truncate with ellipsis |
| `capitalize(str)` | Capitalize first letter |
| `titleCase(str)` | Capitalize each word |
| `reverse(str)` | Reverse string |
| `wordCount(str)` | Count words |
| `charCount(str, excludeSpaces)` | Count characters |
| `removeExtraSpaces(str)` | Clean whitespace |
| `isEmpty(str)` | Check if empty/whitespace |
| `pad(str, len, char, pos)` | Pad to length |

## License

MIT
npm package: @satyajit_me/xss-sanitizer
Description: Clean and sanitize HTML to prevent XSS attacks
Author: Satyajit
Latest version: 1.0.1

# XSS Sanitizer

Clean and sanitize HTML to prevent XSS attacks.

## Installation

```bash
npm install xss-sanitizer
```

## Quick Start

```javascript
import { sanitize, escapeHtml, stripTags } from 'xss-sanitizer';

// Sanitize HTML (keep safe tags, remove dangerous ones)
sanitize('<p onclick="alert(1)">Hello <script>evil</script></p>')
// '<p>Hello </p>'

// Escape all HTML
escapeHtml('<script>alert("xss")</script>')
// '&lt;script&gt;alert(&quot;xss&quot;)&lt;/script&gt;'

// Remove all tags
stripTags('<p>Hello <b>World</b></p>')
// 'Hello World'
```

## API

### escapeHtml(str)
Escapes HTML entities (`<`, `>`, `&`, `"`, `'`, etc.)

```javascript
escapeHtml('<script>') // '&lt;script&gt;'
```

### unescapeHtml(str)
Reverses HTML entity escaping.

### stripTags(html)
Removes all HTML tags, keeping only text.

```javascript
stripTags('<p>Hello <b>World</b></p>') // 'Hello World'
```

### sanitize(html, options)
Smart sanitization - keeps safe tags, removes dangerous ones.

```javascript
// Basic usage
sanitize('<p onclick="evil()">Hello</p>')
// '<p>Hello</p>'

// Options
sanitize(html, {
  allowedTags: ['p', 'b', 'i', 'a'],     // Override allowed tags
  allowedAttributes: {                    // Override allowed attrs
    '*': ['class'],
    'a': ['href']
  },
  stripAll: true,                         // Remove ALL tags
  escapeAll: true                         // Escape ALL HTML
})
```

### isSafeUrl(url)
Check if URL is safe (no javascript:, data:, etc.)

```javascript
isSafeUrl('https://example.com')    // true
isSafeUrl('javascript:alert(1)')    // false
```

### sanitizeUrl(url)
Returns safe URL or empty string.

### sanitizeText(text)
Full HTML escaping for user text display.

## Default Allowed Tags

`a`, `b`, `blockquote`, `br`, `code`, `div`, `em`, `h1-h6`, `hr`, `i`, `img`, `li`, `ol`, `p`, `pre`, `span`, `strong`, `table`, `td`, `th`, `tr`, `ul`, and more.

## License

MIT
npm package: @satyam1990/learn-mcp
Description: A simple MCP server that learns from the user with Google AI SDK
Author: Satyam
Latest version: 1.0.3

This is basic standerd MCP server example code

clone repo 

npm i

"serve:build": "tsc"    
    - to build 

"server:build:watch": "tsc --watch"   
    - it will watch your changes if changes made build again

"server:dev": "tsx src/server.ts"   
    - start server

"server:inspect": "set DANGEROUSLY_OMIT_AUTH=true && npx @modelcontextprotocol/inspector npm run server:dev"
    - IMP - to inspect the server
npm package: @satyam95/donutui
Description: **Donut UI** is a sleek React component library designed to work seamlessly with Tailwind CSS. It provides a variety of UI components that are easily customizable with your own color themes.
Author: Satyam Sagar
Latest version: 0.0.2

# Donut UI

**Donut UI** is a sleek React component library designed to work seamlessly with Tailwind CSS. It provides a variety of UI components that are easily customizable with your own color themes.

## Prerequisites

- **React**: Ensure your project is set up with React.
- **Tailwind CSS**: This library uses Tailwind CSS, so make sure it's installed and properly configured in your project.

## Installation

Install **Donut UI** via npm:

```bash
npm install @satyam95/donutui
```

## Tailwind CSS Theme Configuration

For Tailwind CSS 4+, update your base colors by including the following CSS variables in your configuration. You can add them directly within your CSS file or update your Tailwind configuration to include your custom theme:

## Usage Example

After installation and configuration, you can start using the components in your project. Below is an example demonstrating how to import and use the **Button** component:

```css
@theme {
  --color-primary: oklch(22.5% 0.146 265.82);
  --color-primary-foreground: oklch(100% 0 0);
  --color-secondary: oklch(0.69 0.146 265.82);
  --color-secondary-foreground: oklch(100% 0 0);
  --color-destructive: oklch(63.7% 0.237 25.331);
  --color-background: oklch(1 0 0);
  --color-accent: oklch(0.97 0 0);
}
```

```tsx
import React from 'react';
import { Button } from 'donut-ui';

const App = () => {
  return (
    <div className="p-4">
      <Button>Default Button</Button>
    </div>
  );
};

export default App;
```

## Contributing

Contributions, bug reports, and feature requests are welcome! If you'd like to contribute, please open an issue or submit a pull request in the GitHub repository.

## License

This project is licensed under the MIT License. See the LICENSE file for details.
npm package: @satyamatwork/live
Description: sdk package for pbj live
Author: iamchristough
Latest version: 1.0.8

# live.js
PBJ Live Javascript SDK (Currently Docs only)


## Usage
Import javascript file
```
<script src="https://js.pbj.live/v1/sdk.js"></script>
```

This script will expose a global `Live` class. Initiate the class with your organization api key:

```
const live = new Live("pk_....")
```

When the `Live` class is initiated you will be able to do several things:

- Render a PBJ Live stream to a HTML element
- Retrieve information from our APIs

## Elements

### Embed element
*Currently our recommended way to integrate with PBJ Live.*

In your html, create a `div` tag with your preferred naming, we use `live-element` in these examples. 

So in your html, add:
```html
<html>
  <body>
    <!--- Add Live element here ---!>
    <div id="live-element"></div>
    
    <script src="https://js.pbj.live/v1/sdk.js"></script>
    <script type="text/javascript">
      var live = new Live("<Your API Key>");
      
      // Create instance of the iframe embed
      var embedPlayer = live.elements.embed()
       
      // Mount the player to the div#live-element in our html
      embedPlayer.mount("#live-element")
    </script>
  </body>
</html>
```

In the background, this `embed()` method will create an iFrame that will injected into your html element, we also offer a lower level solution via the `live.elements.video()` method.



### Video Element
```
const episode = live.elements.video();
```

#### Mount to HTML object

Then mount this element to your HTML element:
```js
const videoElement = live.elements.video({
  episode: id
});

videoElement.mount("#live-video")
```

#### Start video
```
videoElement.start();
```

#### Stop video
```
videoElement.stop();
```

#### Remove video element
```
videoElement.dispose();
```

#### Change volume
```
videoElement.volume(0.5)
```

A number from 0 to 1

#### Open full screen programatically
```
videoElement.openFullscreen()
```

#### Close full screen programatically
```
videoElement.closeFullscreen()
```

#### Get episode schedule
```
live.episodes.schedule()
  .then((episodes) => {
    const = nextEpisode = episodes[0]
 })
```

## Get episodes for show
```
live.episodes.list({
  show: "..."
})
  .then(...)
```

## Get current organization
```
live.organizations.current()
```


```
live.episodes.schedule()
live.episodes.detail({ id })

live.shows.detail()
live.shows.list()

live.organizations.current()

live.users.login()
live.users.register()
```


## Event changes
```
live.events.on('episode-status-update', () => ...)
```


## Realtime sockets

### Subscribing
Sockets are added to the `Live` instance through the `socket` property, subscribing to a specific event can be done by using:
```js
live.sockets.subscribeToEvent(live.sockets.commandTypes.EPISODE_STATUS_UPDATE,(message)=>{
    console.log('EPISODE_STATUS_UPDATE', message)
})
```

### Get Episode Command Types
The different command types that are available can be found here:

```
 live.sockets.commandTypes
```
npm package: @satyamgupta14333/digit-ui-css
Description: <!-- TODO: update this -->
Author: satyam
Latest version: 1.0.2

<!-- TODO: update this -->

# digit-ui-css

## Install

```bash
npm install --save @egovernments/digit-ui-css
```

## Limitation

```bash
This Package is more specific to DIGIT-UI's can be used across mission's
It is the base css for all Digit UI's
```

## Usage

After adding the dependency make sure you have this dependency in

```bash
frontend/micro-ui/web/package.json
```

```json
"@egovernments/digit-ui-css":"^1.5.0",
```

then navigate to App.js

```bash
frontend/micro-ui/web/public/index.html
```

```jsx
/** add this import **/

  <link rel="stylesheet" href="https://unpkg.com/@egovernments/digit-ui-css@1.5.22/dist/index.css" />

```
### Changelog

```bash
1.8.1 added workbench releated css for popup
1.8.0 Workbench v1.0
1.8.0-beta.13 fixed the login text styling issue
1.8.0-beta.1 styles for login dropdown and homepage dropdowns
1.8.0-beta added workbench related css and some new Digit v2 constants based on em
1.7.0 urban 2.9
1.6.0 urban 2.8
1.5.41 added styles for login dropdown and homepage dropdowns
1.5.40 aligment issue in edit and logout
1.5.39 updated login scss and alignment issues
1.5.37 updated the readme content
1.5.36 enhanced the formcomposer with header attribute
1.5.35 Fixed the card css issues
1.5.34 Fixed breadcrumb styling issue
1.5.33 fixed some card related css issues due to v2 css
1.5.32 newer css DIGITv2 added and corrected few existing issues
1.5.31 Corrected the CSS for inbox composers and default core ui
1.5.30 Updated the css for dynamic drodown filter dss
1.5.29 layout issues fixed
1.5.28 Horizontal Bar chart alignment fixes
1.5.27 DSS UI alignment fixes for Horizontal Metric and bar chart
1.5.26 added new css class for dss enhancements
1.5.25 added the css of inbox search composers
1.5.24 added the readme file
1.5.23 base version
```
## Contributors

[jagankumar-egov] [nipunarora-eGov] [Tulika-eGov] [Ramkrishna-egov] [nabeelmd-eGov] [anil-egov] [vamshikrishnakole-wtt-egov] 

### Published from DIGIT Frontend 
DIGIT Frontend Repo (https://github.com/egovernments/Digit-Frontend/tree/master)

## License

MIT © [jagankumar-egov](https://github.com/jagankumar-egov)