open-index/open-npm huggingface dataset:
npm package: @rajeev02/locale
Description: Indian-first localization engine — translation, Lakh/Crore number formatting, INR currency, phone formatting, Indic script transliteration
Author: Rajeev Kumar Joshi
Latest version: 0.2.2

# @rajeev02/locale

[![npm](https://img.shields.io/npm/v/@rajeev02/locale)](https://www.npmjs.com/package/@rajeev02/locale)

**Indian-first localization engine** — translation system, Lakh/Crore number formatting, INR currency, phone formatting, and Indic script transliteration across 10 scripts.

Powered by a Rust core (`rajeev-locale-core`) compiled to native (iOS/Android via UniFFI) and WASM (Web).

## Platform Support

| Platform             | Engine       | Binding         |
| -------------------- | ------------ | --------------- |
| iOS 16+              | Rust → UniFFI | Swift           |
| Android 7+ (API 24)  | Rust → UniFFI | Kotlin          |
| Web                  | Rust → WASM  | `wasm-bindgen`  |
| watchOS 9+ / Wear OS | Rust → UniFFI | Native          |
| Android Auto         | Rust → UniFFI | Kotlin          |

## Installation

```bash
npm install @rajeev02/locale
```

## Quick Start

```typescript
import {
  TranslationEngine,
  formatINR,
  formatIndianNumber,
  transliterateToDevanagari,
  detectScript,
} from '@rajeev02/locale';

// Translation
const engine = new TranslationEngine('hi', 'en');
engine.loadLanguage({
  code: 'hi', name: 'Hindi', nativeName: 'हिन्दी', rtl: false,
  translations: { greeting: 'नमस्ते {{name}}!' },
});
engine.translate('greeting', { name: 'Rajeev' }); // → 'नमस्ते Rajeev!'

// Currency
formatINR(1500000);           // → '₹15,00,000.00'
formatINRShort(1500000);      // → '₹15 Lakh'

// Number formatting
formatIndianNumber(12345678); // → '1,23,45,678'

// Transliteration
transliterateToDevanagari('namaste'); // → 'नमस्ते'

// Script detection
detectScript('தமிழ் மொழி');  // → 'Tamil'
```

## API Reference

| Function | Description |
|----------|-------------|
| `TranslationEngine` | Multi-language translation with interpolation & pluralization |
| `formatIndianNumber(num)` | Indian numbering system (Lakh/Crore grouping) |
| `formatINR(amount)` | Format as ₹ with Indian grouping |
| `formatINRShort(amount)` | Lakh/Crore shorthand (₹15 Lakh, ₹2.5 Crore) |
| `formatPhoneIndian(number)` | Format Indian phone with +91 prefix |
| `formatDateIndian(y, m, d)` | DD/MM/YYYY format |
| `formatTime12h(h, m)` | 12-hour time format |
| `transliterateToDevanagari(input)` | Latin → Devanagari conversion |
| `detectScript(text)` | Detect Indic script from Unicode ranges |
| `supportedScripts()` | List all 10 supported scripts |

## License

MIT © Rajeev Kumar Joshi
npm package: @rajeev02/network
Description: Connectivity-aware networking layer — real-time status, adaptive quality, priority request queue, HTTP cache, gzip compression
Author: Rajeev Kumar Joshi
Latest version: 0.2.2

# @rajeev02/network

[![npm](https://img.shields.io/npm/v/@rajeev02/network)](https://www.npmjs.com/package/@rajeev02/network)

**Connectivity-aware networking layer** with real-time status monitoring, adaptive quality suggestions, persistent priority request queue, HTTP cache, and gzip compression.

Powered by a Rust core (`rajeev-network-core`) compiled to native (iOS/Android via UniFFI) and WASM (Web).

## Platform Support

| Platform             | Engine       | Binding         |
| -------------------- | ------------ | --------------- |
| iOS 16+              | Rust → UniFFI | Swift           |
| Android 7+ (API 24)  | Rust → UniFFI | Kotlin          |
| Web                  | Rust → WASM  | `wasm-bindgen`  |
| watchOS 9+ / Wear OS | Rust → UniFFI | Native          |
| Android Auto         | Rust → UniFFI | Kotlin          |

## Installation

```bash
npm install @rajeev02/network
```

## Quick Start

```typescript
import { RajeevNetwork } from '@rajeev02/network';

const network = new RajeevNetwork({
  appId: 'my-app',
  dbDir: '/data/network',
  enableQueue: true,
  enableCache: true,
  autoCompress: true,
});

// Update connectivity status
network.updateStatus('wifi', 50000, 30, false);

// Adaptive suggestions
const timeout = network.getSuggestedTimeoutMs();     // 10000
const quality = network.getSuggestedImageQuality();   // { quality: 'High', ... }

// Request queue (offline-first)
const id = network.enqueueRequest(
  'POST', 'https://api.example.com/data',
  '{"Content-Type":"application/json"}',
  JSON.stringify({ key: 'value' }),
  'high', true, 'api'
);

// HTTP cache
network.cacheResponse('GET', '/api/users', 200, '{}', data, 300);
const cached = network.getCached('GET', '/api/users');

// Compression
import { compressString, shouldCompress } from '@rajeev02/network';
if (shouldCompress(payload)) {
  const compressed = compressString(payload);
}
```

## API Reference

| Method | Description |
|--------|-------------|
| `updateStatus(type, kbps, rtt, saveData)` | Update network connectivity |
| `getStatus()` | Get current network state |
| `getSuggestedTimeoutMs()` | Adaptive timeout based on quality |
| `getSuggestedImageQuality()` | Adaptive image quality suggestion |
| `recordTransfer(bytes, ms)` | Record transfer for bandwidth estimation |
| `getEstimatedBandwidthKbps()` | EWMA bandwidth estimate |
| `enqueueRequest(...)` | Add to priority offline queue |
| `dequeueRequest()` | Get next request to send |
| `completeRequest(id)` | Mark request completed |
| `failRequest(id)` | Schedule retry with backoff |
| `getCached(method, url)` | Retrieve cached response |
| `cacheResponse(...)` | Cache an HTTP response |
| `getCacheStats()` | Cache hit/miss statistics |
| `cleanup()` | Remove expired entries |

## License

MIT © Rajeev Kumar Joshi
npm package: @rajeev02/sync
Description: Offline-first sync engine with CRDT conflict resolution, Hybrid Logical Clock ordering, persistent operation log, and multi-device convergence
Author: Rajeev Kumar Joshi
Latest version: 0.2.2

# @rajeev02/sync

[![npm](https://img.shields.io/npm/v/@rajeev02/sync)](https://www.npmjs.com/package/@rajeev02/sync)

**Offline-first sync engine** with CRDT-based conflict resolution, Hybrid Logical Clock causal ordering, persistent operation log, and multi-device convergence.

Powered by a Rust core (`rajeev-sync-core`) compiled to native (iOS/Android via UniFFI) and WASM (Web).

## Platform Support

| Platform             | Engine       | Binding         |
| -------------------- | ------------ | --------------- |
| iOS 16+              | Rust → UniFFI | Swift           |
| Android 7+ (API 24)  | Rust → UniFFI | Kotlin          |
| Web                  | Rust → WASM  | `wasm-bindgen`  |
| watchOS 9+ / Wear OS | Rust → UniFFI | Native          |
| Android Auto         | Rust → UniFFI | Kotlin          |

## Installation

```bash
npm install @rajeev02/sync
```

## Quick Start

```typescript
import { SyncStorage } from '@rajeev02/sync';

// Each device gets a unique node ID
const storage = new SyncStorage(':memory:', 'device-phone-01');

// Insert documents
const docId = storage.insert('tasks', JSON.stringify({
  title: 'Buy groceries',
  done: false,
}));

// Update fields
storage.update('tasks', docId, 'done', 'true');

// Query
const tasks = storage.query('tasks', 10);

// Get unsynced operations for server push
const ops = storage.getUnsyncedOps(100);

// After server confirms receipt
storage.markSynced(ops.map(op => op.id));
```

## CRDT Documents

```typescript
import { CrdtDocument, lwwMerge, HLC } from '@rajeev02/sync';

// Create documents on two devices
const docA = CrdtDocument.create('doc-001', 'tasks', 'device-A');
const docB = CrdtDocument.create('doc-001', 'tasks', 'device-B');

// Both edit the same field
docA.setField('title', 'Buy pasta');
docB.setField('title', 'Buy rice');

// Merge — later HLC wins deterministically
docA.merge(docB);
docB.merge(docA);
// Both converge to the same value ✅
```

## API Reference

| Method | Description |
|--------|-------------|
| `SyncStorage(dbPath, nodeId)` | Create sync storage instance |
| `insert(collection, dataJson)` | Insert document, returns UUID |
| `update(collection, docId, field, value)` | Update single field |
| `delete(collection, docId)` | Soft-delete document |
| `get(collection, docId)` | Get document as JSON |
| `query(collection, limit)` | Query documents in collection |
| `getUnsyncedOps(limit)` | Get unsynced ops for server push |
| `markSynced(opIds)` | Mark ops as synced |
| `purgeOldOps(hours)` | Remove old synced ops |
| `getStats()` | Storage statistics |
| `CrdtDocument.create(id, collection, nodeId)` | Create CRDT document |
| `HLC(nodeId)` | Create Hybrid Logical Clock |
| `compareHLC(a, b)` | Compare two HLC timestamps |
| `lwwMerge(local, remote)` | Last-Writer-Wins merge |

## License

MIT © Rajeev Kumar Joshi
npm package: @rajeev3/smart-api-kit
Description: Ready-made tools for backend developers: response handler, logger, validators, middleware, and more.
Author: Smart API Toolkit
Latest version: 1.0.3

# Smart API Toolkit 🚀

Ready-made tools for backend developers. Start simple, scale to production.

## Installation

```bash
npm install @rajeev3/smart-api-kit
```

## Quick Start

```javascript
const api = require('@rajeev3/smart-api-kit');

// Response handlers
api.success({ user: 'John' }, 'User created');
api.error('Validation failed', 400);

// Logger
api.logger.info('Server started on port 3000');

// Validators
api.validateEmail('test@example.com'); // true
api.validatePhone('+1234567890'); // true
```

## Features

### 1. Response Handler
Standardized API responses.

```javascript
api.success(data, message = 'Success', code = 200);
api.error(message, code = 500);
// Returns: { success: true/false, data/message, code }
```

### 2. Logger
Simple leveled logging.

```javascript
const log = api.logger;
log.info('Info message');
log.error('Error message');
log.warn('Warning message');
```

### 3. Validators
Basic input validation.

```javascript
api.validateEmail(email);
api.validatePhone(phone);
```

### 4. Express Middleware 🔥
**Logger Middleware**
```javascript
const express = require('express');
const api = require('@rajeev3/smart-api-kit');

const app = express();
app.use(express.json());
app.use(api.middleware.loggerMiddleware());  // Logs all requests

app.listen(3000);
```

**Validation Middleware** (auto-responds with api.error on fail)
```javascript
app.post('/register', 
  api.middleware.validateEmailMiddleware('body.email'),  // req.body.email
  api.middleware.validatePhoneMiddleware('body.phone'),
  (req, res) => res.json(api.success({ user: req.body }))
);
```

## More Coming Soon
- JWT Auth
- Rate limiting
- Request tracking

⭐ Star on GitHub: https://github.com/rajeev35/smart-api-kit