or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

index.mddocs/

codinasion

codinasion is a collection of useful TypeScript code snippets and algorithms designed to provide common programming utilities and algorithmic implementations. The package focuses on well-documented, tested, and reusable functions for various computational tasks.

Package Information

  • Package Name: codinasion
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install codinasion

Core Imports

import { helloWorld, bubbleSort } from "codinasion";

For CommonJS:

const { helloWorld, bubbleSort } = require("codinasion");

Basic Usage

import { helloWorld, bubbleSort } from "codinasion";

// Simple hello world utility
helloWorld(); // Outputs: "Hello World"

// Sort an array of numbers
const numbers = [5, 3, 8, 4, 2];
const sorted = bubbleSort(numbers);
console.log(sorted); // Output: [2, 3, 4, 5, 8]

// Handle undefined input gracefully
const emptySorted = bubbleSort(undefined);
console.log(emptySorted); // Output: []

Architecture

codinasion is organized into functional modules:

  • Utilities: Basic utility functions like helloWorld
  • Sorting Algorithms: Mathematical sorting implementations including bubble sort
  • TypeScript First: Full TypeScript support with comprehensive type definitions
  • Well-Tested: Each function includes comprehensive test coverage and error handling

Capabilities

Hello World

Simple utility function that logs "Hello World" to the console.

function helloWorld(): void;

Sorting Algorithms

Mathematical sorting algorithms for array manipulation and ordering.

/**
 * Sorts an array of numbers using the bubble sort algorithm.
 * @param arr - Array of numbers to sort. If undefined, returns empty array.
 * @returns Sorted array of numbers in ascending order.
 */
function bubbleSort(arr: number[] | undefined): number[];

Types

// All functions are exported directly from main module
type SortableArray = number[] | undefined;
type SortedArray = number[];

Usage Examples

Basic Sorting

import { bubbleSort } from "codinasion";

// Sort positive numbers
const numbers = [5, 3, 8, 4, 2];
const sorted = bubbleSort(numbers);
console.log(sorted); // [2, 3, 4, 5, 8]

// Handle negative numbers
const mixed = [-1, 3, -5, 2];
const sortedMixed = bubbleSort(mixed);
console.log(sortedMixed); // [-5, -1, 2, 3]

// Empty and single element arrays
console.log(bubbleSort([])); // []
console.log(bubbleSort([42])); // [42]

Error Handling

import { bubbleSort } from "codinasion";

// Graceful handling of undefined input
const result = bubbleSort(undefined);
console.log(result); // []

// Function modifies input array in-place and returns it
const original = [3, 1, 2];
const sorted = bubbleSort(original);
console.log(original === sorted); // true (same array reference)

Console Output

import { helloWorld } from "codinasion";

// Simple console output for testing or demonstration
helloWorld(); // Logs: "Hello World"

Development Features

  • TypeScript Support: Full type definitions and IntelliSense support
  • Tree Shaking: Optimized for modern bundlers with ES module exports
  • Comprehensive Testing: Each function includes extensive test coverage
  • JSDoc Documentation: Detailed inline documentation with examples
  • Error Handling: Graceful handling of edge cases and invalid inputs

Package Metadata

  • Version: 2025.2.14
  • License: MIT
  • Repository: https://github.com/codinasion/codinasion
  • Author: codinasion (codinasion@gmail.com)
  • Keywords: codinasion, code, tools, typescript