Getting Started โ
Welcome to Outilx documentation!
What is Outilx? โ
Outilx is a modern, modular utility library collection for JavaScript/TypeScript development. It provides high-quality, well-tested utilities across different environments and frameworks.
Current Packages:
- @outilx/core - Core utilities for any JavaScript runtime (Node.js, Deno, Bun, browsers)
- @outilx/browser - Browser-specific utilities (extends @outilx/core)
- @outilx/node - Utilities for Node.js environments
- @outilx/react-hooks - High-quality React Hooks library
- @outilx/ai - AI utilities for code detection and streaming
Features โ
- ๐ฏ Modular - Install only what you need
- ๐ฆ Tree-shakeable - Optimized bundle sizes
- ๐ท TypeScript - Full type definitions included
- โก Modern - Built with latest JavaScript features
- ๐งช Tested - Comprehensive test coverage
Quick Start โ
Choose the package that fits your environment:
bash
npm install @outilx/corebash
npm install @outilx/browserbash
npm install @outilx/nodebash
npm install @outilx/react-hooksbash
npm install @outilx/aiThen import and use:
typescript
import { toArray, TipCache, getUrlParams, parseJsonWithFallback } from '@outilx/core';
const arr = toArray(1); // [1]
const cache = new TipCache(5000);
const params = getUrlParams('foo=bar');typescript
import { toArray, TipCache, getUrlParams, getNetWorkInfo, LocalStorageCache } from '@outilx/browser';
const arr = toArray(1); // [1]
const cache = new TipCache({ ttl: 5000 });
const networkInfo = getNetWorkInfo();typescript
import { ensureDirExists, deleteEmptyDirs } from '@outilx/node';
await ensureDirExists('./my-dir');
await deleteEmptyDirs('./my-dir');typescript
import { useBoolean, useCounter } from '@outilx/react-hooks';
function App() {
const [visible, { toggle }] = useBoolean(false);
const [count, { inc }] = useCounter(0);
return <div>...</div>;
}typescript
import { detectCodeBlocks, useStreamingSimulator } from '@outilx/ai';
const blocks = detectCodeBlocks(markdownText);
const { content, startStreaming } = useStreamingSimulator({
chunks: ['Hello', ' ', 'World'],
interval: 100
});Next Steps โ
- Learn about @outilx/core
- Learn about @outilx/browser
- Learn about @outilx/node
- Learn about @outilx/react-hooks
- Learn about @outilx/ai
- Browse the API Reference