Functional programming patterns for TypeScript.
| Package | Description | Version |
|---|---|---|
@deessejs/core |
Functional programming patterns |
- TypeScript 5.0+
- Node.js 20+
# Install core
npm install @deessejs/core
# Or using pnpm
pnpm add @deessejs/core
# Or using yarn
yarn add @deessejs/coreimport { success, cause, exception, isSuccess, isCause, isException, Outcome } from '@deessejs/core'
// Success - Normal Operation Result
const ok = success({ id: 1, name: 'John' })
if (isSuccess(ok)) {
console.log(ok.value.name)
}
// Cause - Domain Errors
const notFound = cause({
name: 'NOT_FOUND',
message: 'User not found',
data: { id: 123 }
})
// Exception - System Errors
const crash = exception({
name: 'DATABASE_ERROR',
message: 'Connection failed'
})# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage
# Lint
pnpm lint
# Type check
pnpm typecheckContributions are welcome! Please feel free to submit a Pull Request.
- Nesalia Inc.
If you discover any security vulnerabilities, please send an e-mail to security@nesalia.com.
MIT License - see the LICENSE file for details.