npm

Need private packages and team management tools?Check out npm Orgs. »

text-mask-siret

1.0.0 • Public • Published

text-mask-siret Build Status Coverage Status

Text Mask function for french SIRET and SIREN.

Example

Demo available here: dimitrinicolas.github.io/text-mask-siret/example

Installation

npm i text-mask-siret

Usage

With React.js

import React from 'react'
import MaskedInput from 'react-text-mask'
import { siretMask, sirenMask } from 'text-mask-siret';
 
const mask = siretMask;
/**
 * Or
 * const mask = sirenMask;
 */
 
export default () => <MaskedInput mask={mask} />;

In Vanilla JS

<script src="./node_modules/vanilla-text-mask/dist/vanillaTextMask.js"></script>
<script src="./node_modules/text-mask-siret/dist/text-mask-siret.umd.min.js"></script>
<script>
  vanillaTextMask.maskInput({
    inputElement: document.getElementById('siret-input'),
    mask: textMaskSiret.siretMask,
    // Or mask: textMaskSiret.sirenMask
  });
});
</script> 

Build

Compile with Rollup:

npm run build

Build and test:

npm test

Related

  • text-mask - Input mask for React, Angular, Ember, Vue, & plain JavaScript
  • text-mask-vat-id - Text Mask for VAT identification number

License

This project is licensed under the MIT license.

install

npm i text-mask-siret

Downloadsweekly downloads

2

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability