0.2.1 ā¢ Published 14 days ago
ts-extensials v0.2.1
TS extensials (TypeScript essential extensions)
š A project built with TypeScript to provide more useful features.
Table of Contents
Installation
To install this project, run npm install ts-extensials --save-dev
Usage
To use this project, follow these steps:
- Open your main file (e.g.
index.ts
ormain.ts
) to make it usable in a whole project - Import the module you want to use (e.g
import 'ts-extensials/array/array.rust';
) To see all available extensions, check Ready extensions list
Code Examples
Here are some code examples to help you get started:
- Rust-like array methods
// Import a module
import 'ts-extensials/array/array.rust';
const first = [].first();
const last = [].last();
const array = [1, 2, 3, 4, 5];
array.retain(num => num % 2 === 0);
// array = [2, 4]
- C# LINQ-like array methods
// Import a module
import 'ts-extensials/array/array.linq';
const array = [1, 2, 3, 4, 5];
array.sum(); // 15