Enterprise-grade client-side orchestration protocol for modern web applications
CSOP provides a unified interface for managing browser capabilities (storage, compute, sync) with enterprise-grade reliability, performance, and developer experience.
- ποΈ Unified Storage - IndexedDB wrapper with simple API
- β‘ Web Workers - Parallel computation with worker pool management
- π Real-time Sync - WebSocket/Server-Sent Events integration
- π― Type-Safe - Full TypeScript support (coming soon)
- π§ͺ Tested - Comprehensive test suite
- π¦ Lightweight - < 10KB gzipped
- π CDN Ready - Available via unpkg and jsDelivr
npm install @tryboy869/csopyarn add @tryboy869/csoppnpm add @tryboy869/csop<script type="module">
import { CSOP } from 'https://unpkg.com/@tryboy869/csop@0.1.0';
</script><script type="module">
import { CSOP } from 'https://cdn.jsdelivr.net/npm/@tryboy869/csop@0.1.0';
</script>import { CSOP } from '@tryboy869/csop';
// Initialize CSOP
const csop = new CSOP();
await csop.init();
// Use storage capability
const storage = csop.getCapability('storage');
await storage.set('user', { name: 'John', role: 'admin' });
const user = await storage.get('user');
console.log(user); // { name: 'John', role: 'admin' }import { CSOP } from '@tryboy869/csop';
const csop = new CSOP({
storage: {
dbName: 'myapp',
version: 1
},
compute: {
maxWorkers: 4
}
});
await csop.init();Creates a new CSOP instance with optional configuration.
const csop = new CSOP({
storage: { dbName: 'myapp' },
compute: { maxWorkers: 4 },
sync: { endpoint: 'wss://api.example.com' }
});Initializes all registered capabilities.
await csop.init();Retrieves a registered capability.
const storage = csop.getCapability('storage');Stores a value in IndexedDB.
await storage.set('settings', { theme: 'dark', lang: 'en' });Retrieves a value from IndexedDB.
const settings = await storage.get('settings');Deletes a value from IndexedDB.
await storage.delete('settings');Clears all data from IndexedDB.
await storage.clear();Executes a task in a Web Worker.
const result = await compute.execute((data) => {
return data.numbers.reduce((a, b) => a + b, 0);
}, { numbers: [1, 2, 3, 4, 5] });
console.log(result); // 15Establishes a real-time connection.
await sync.connect();Subscribes to a channel for real-time updates.
sync.subscribe('updates', (data) => {
console.log('Received:', data);
});CSOP is available on multiple CDNs for easy integration without a build step.
<!DOCTYPE html>
<html>
<head>
<title>CSOP Example</title>
</head>
<body>
<script type="module">
import { CSOP } from 'https://unpkg.com/@tryboy869/csop@0.1.0';
const csop = new CSOP();
await csop.init();
const storage = csop.getCapability('storage');
await storage.set('message', 'Hello from CDN!');
const message = await storage.get('message');
console.log(message);
</script>
</body>
</html><script type="module">
import { CSOP } from 'https://cdn.jsdelivr.net/npm/@tryboy869/csop@0.1.0';
// Your code here
</script>const csop = new CSOP({
storage: {
dbName: 'myapp-db',
version: 2,
stores: ['users', 'posts', 'settings']
}
});const csop = new CSOP({
compute: {
maxWorkers: navigator.hardwareConcurrency || 4,
timeout: 30000 // 30 seconds
}
});const csop = new CSOP({
sync: {
endpoint: 'wss://api.example.com/realtime',
reconnect: true,
reconnectDelay: 1000
}
});CSOP includes a comprehensive test suite.
# Run tests
npm test
# Run tests with coverage
npm run test:coverageCSOP/
βββ src/
β βββ csop.js # Core orchestrator
β βββ validation.js # Input validation
β βββ errors.js # Error codes
β βββ utils.js # Utilities
β βββ capabilities/
β βββ storage.js # IndexedDB capability
β βββ compute.js # Web Workers capability
β βββ sync.js # Real-time sync capability
βββ test/
β βββ runner.js # Test suite
βββ package.json
βββ README.md
βββ LICENSE
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
DAOUDA Abdoul Anzize - Nexus Studio
- GitHub: @Nexus-Studio-CEO
- NPM: @tryboy869
- Email: nexusstudio100@gmail.com
- π¦ NPM Package
- π GitHub Repository
- π Issue Tracker
- π Changelog
- π unpkg CDN
- π jsDelivr CDN
- Built with β€οΈ by Nexus Studio
- Powered by modern web standards (IndexedDB, Web Workers, WebSockets)
- AI-assisted development with Groq Llama 3.3
Made with β€οΈ for the JavaScript community