Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

input-core

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

input-core

Core abilities of masked-input. Usefull to create custom input processors

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by4.25%
Maintainers
1
Weekly downloads
 
Created
Source

input-core

This project would help you if:

  1. You don't need to create an input for user, but only formatting to show data as a plain text
  2. You want to create your own compnent which will work with inputs

Step-by-step guide:

  1. Install it

    npm install --save input-core
    

    or

    yarn add input-core
    
  2. import it:

    import { createInput } from 'input-core';
    
  3. Create an object (for example, if we want to format phone):

export default function formatPhone(value, mask) {
  const input = createInput({
    value,
    mask,
  });

  return input.getVisibleValue();
}
  1. Use it wherever you need ;)
const phone = '9651112222';
...
formatPhone(phone, '+7 (000) 000 00-00'); // returns +7 (965) 111 22-22

License

MIT

Keywords

FAQs

Package last updated on 03 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc