unreal4u/rutverifier-js

Javascript version of unreal4u/rutverifier

Installs: 60

Dependents: 1

Watchers: 1

Language: JavaScript

v1.0.1 2014-03-22 00:33 UTC

README

Build Status

Credits

This class is made by unreal4u (Camilo Sperberg). unreal4u.com.

About this class

  • Can be used to verify chilean RUT (Rol único tributario) or RUN (Rol único nacional). (Difference [spanish])
  • Is a pure JavaScript implementation. Will return true or false depending on whether the given RUT is valid or not.
  • @TODO Will also format the RUT/RUN into the correct format.

Basic usage

<script type="text/javascript" src="dist/rutverifier.min.js">
if (rutVerification('30.686.957-4')) {
    console.log('RUT is valid');
} else {
    console.log('RUT is not valid');
}
</script>
  • Congratulations! That's all you've had to do.

Developing

In order to develop, you'll better off installing Node.js in order to run the automated tests and other stuff as well.

Then execute the following at the root of the project:

npm install

In order to do the JavaScript testing and validation, execute the following at the project's root dir:

grunt

Recommended is to install grunt as a global dependency:

npm install -g grunt-cli

Pending

  • Improvements on formatting RUT
  • PHP class that can read out the minified version of this class
  • Submit to packagist in order to add it as an dependency of unreal4u/rutverifier

Version History

  • 1.0.0 :
    • Initial version

Contact the author