stacks/ts-inputs
publicClone
Push over the same URL. A password will not work: create a token under access tokens and use it in place of one.
- .config
- .github
- .vscode
- docs
- packages
- scripts
- test
- .editorconfig 147 B
- .gitattributes 12 B
- .gitignore 127 B
- buddy-bot.config.ts 857 B
- build.ts 133 B
- bun.lock 87.7 KB
- bunfig.toml 107 B
- CHANGELOG.md 10.2 KB
- clarity.config.ts 133 B
- CLAUDE.md 1.5 KB
- deps.yaml 32 B
- LICENSE.md 1.1 KB
- package.json 2.3 KB
- pkgx.yaml 32 B
- README.md 4.3 KB
- tsconfig.json 903 B

TS-Inputs
A TypeScript library providing specialized input handling and formatting for various data types.
Overview
TS-Inputs is a modular library that provides specialized input handling, formatting, and validation for different types of data. It's designed to be used in web applications where precise input control and formatting are required.
Features
- Credit Card Input: Formatting and validation for credit card numbers
- Date Input: Specialized date input handling
- Time Input: Time format handling
- Numeral Input: Number formatting and validation
- General Input: Common input handling utilities
- Cursor Tracker: Input cursor position tracking
Project Structure
src/
├── common/ # Shared utilities and types
│ ├── types.ts # Common type definitions
│ └── utils.ts # Shared utility functions
├── credit-card/ # Credit card input handling
├── cursor-tracker/ # Cursor position tracking
├── date/ # Date input handling
├── general/ # General input utilities
├── numeral/ # Number formatting
└── time/ # Time input handlingCommon Utilities
The library provides several common utilities and types:
RequireExactlyOne: Type utility for requiring exactly one property from a setDelimiterType: Type definition for input delimitersBlocksType: Type for input block definitions- Various interfaces for input formatting and delimiter handling
Usage
import { creditCard, date, numeral, time } from 'ts-inputs'
// Example usage with credit card input
const formattedCard = creditCard.format('4111111111111111')
// Result: '4111 1111 1111 1111'Installation
npm install ts-inputs
# or
yarn add ts-inputsContributing
Contributions are welcome! Please feel free to submit a Pull Request.
Testing
bun testChangelog
Please see our releases page for more information on what has changed recently.
Stargazers
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Join the Stacks Discord Server
Postcardware
"Software that is free, but hopes for a postcard." We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
Credits
Sponsors
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
License
The MIT License (MIT). Please see LICENSE for more information.
Made with 💙
[codecov-href]: https://codecov.io/gh/stacksjs/ts-inputs -->