The Wayback Machine - https://web.archive.org/web/20221206231702/https://github.com/tomayac/js-input-masking-polyfill
Skip to content

tomayac/js-input-masking-polyfill

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

js-input-masking-polyfill

A work-in-progress polyfill for the Intl.InputMask 🎭 proposal.

Do not use this in production, there are still many flaws.

Status

Unstable. Submitted as an idea to TC39.

Installation

npm install --save js-input-masking-polyfill

Usage

import 'js-input-masking-polyfill';

new Intl.InputMask('credit-card-number').format('4012888888881881');
// "4012 8888 8888 1881"

// 15 digits.
new Intl.InputMask('credit-card-number').format('378282246310005');
// "3782 822463 10005"

Demo

You can see Intl.InputMask in action in the demo.

License

Apache 2.0

Releases

No releases published

Packages

No packages published