Reality is your canvas
InSpatial | Description | Link |
---|---|---|
Universal Libraries & Frameworks | inspatial.dev | |
Backend APIs and SDKs | inspatial.cloud | |
Build and manage your InSpatial apps | inspatial.app | |
Deploy and discover InSpatial apps | inspatial.store |
InSpatial util is your Swiss Army knife for universal and spatial application development. It provides a collection of powerful, type-safe utility functions to streamline your workflow and enhance your projects.
🧰 Comprehensive set of utility functions for common tasks, enhancing productivity and efficiency.
🎨 CSS class and string merging with kit
and variant
for seamless styling.
📅 Advanced calendar and date manipulation utilities for precise time management.
🔢 Array and mathematical helpers to simplify complex operations.
🔍 Focus and input styling utilities to improve user interface interactions.
🔀 Array shuffling and manipulation functions for dynamic data handling.
📄 Extensive text and data formatting utilities for clean and readable outputs.
🌐 Domain and URL utilities for robust web application development.
🔧 TypeScript type utilities for safer and more reliable code.
📊 Data extraction and manipulation tools for effective data processing.
🌍 Country and encoding utilities for internationalization and data encoding needs.
... and more!
These features make InSpatial util a powerful toolkit for developers working on universal and spatial applications.
Choose your preferred package manager:
deno install jsr:@inspatial/util
npx jsr add @inspatial/util
yarn dlx jsr add @inspatial/util
pnpm dlx jsr add @inspatial/util
bunx jsr add @inspatial/util
InSpatial util includes the following utility functions:
capitalize
: Capitalizes the first letter of a string.kit
and variant
: CSS class and string merging utilities.shuffle
: Randomly shuffles an array.shuffled
: Returns a new array with shuffled elements.focusInput
, hasErrorInput
, focusRing
: Input styling utilities for focus and error states.range
: Generates an array of numbers within a specified range.milliseconds
: Converts time units to milliseconds.crossArray
: Crosses two arrays to produce a Cartesian product.dedupe
: Removes duplicate elements from an array.eq
: Checks for deep equality between two values.random
: Generates a random number within a specified range.swap
: Swaps two elements in an array.trackDebug
: Utility for tracking and debugging.domainMatcher
: Matches a domain against a list of patterns.prettify
: Formats data into a more readable form.format
: Formats strings with placeholders.formatTime
: Formats time values into human-readable strings.getRandomKitColors
: Generates random color schemes for UI components.mergeRef
: Merges multiple React refs into one.generateUniqueId
: Generates a unique identifier.copyToClipboard
: Copies a URL to the clipboard and executes an optional callback.openLink
: Opens a URL in a new browser tab.printPage
: Triggers the browser's print dialog for the current page.replaceNonDigits
: Removes non-digit characters from a string.currency
: Formats numbers as currency strings.share
: Shares content using the Web Share API.dateTime
: Utilities for date and time manipulation.ulid
: Generates a Universally Unique Lexicographically Sortable Identifier.csv
: Parses and generates CSV data.extractor
: Extracts specific data from a larger dataset.text
: Text manipulation utilities.collection
: Provides collection utilities from the standard library.countries
: Utilities for handling country data.encoding
: Utilities for encoding and decoding data.regexEscape
: Escapes special characters in a regex pattern.types
: Type utilities for TypeScript.buildMessage
: Constructs a formatted message to represent differences between data sets.sameStart
: Checks if two strings start with the same sequence.farthestPoint
: Finds the farthest point in a dataset.difference
: Calculates the difference between two datasets.convertImageToBase64DOM
: Converts an image file to a base64 string using the DOM.svgToTinyDataUri
: Converts an SVG to a tiny data URI.svgToSrcSet
: Converts an SVG to a srcset-compatible data URI.stringify
: Converts an object to a string.For detailed usage and parameters of each utility, please refer to the source code or our comprehensive documentation.
To begin your journey with InSpatial Core, visit our comprehensive documentation at inspatial.dev.
We welcome contributions from the community! Please read our Contributing Guidelines to get started.
InSpatial Core is released under the Apache 2.0 License. See the LICENSE file for details.
Add Package
deno add jsr:@inspatial/util
Import symbol
import * as util from "@inspatial/util";
---- OR ----
Import directly with a jsr specifier
import * as util from "jsr:@inspatial/util";
Add Package
npx jsr add @inspatial/util
Import symbol
import * as util from "@inspatial/util";
Add Package
yarn dlx jsr add @inspatial/util
Import symbol
import * as util from "@inspatial/util";
Add Package
pnpm dlx jsr add @inspatial/util
Import symbol
import * as util from "@inspatial/util";
Add Package
bunx jsr add @inspatial/util
Import symbol
import * as util from "@inspatial/util";