diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f6533bc0..1dfcbdf36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ #### HEAD +- Migrate to ES6 + ([#496](https://github.com/chriso/validator.js/pull/496)) +- Break the library up so that individual functions can be imported + ([#496](https://github.com/chriso/validator.js/pull/496)) +- Remove auto-coercion of input to a string + ([#496](https://github.com/chriso/validator.js/pull/496)) +- Remove the `extend()` function + ([#496](https://github.com/chriso/validator.js/pull/496)) +- Added Arabic locales to `isAlpha()` and `isAlphanumeric()` + ([#496](https://github.com/chriso/validator.js/pull/496#issuecomment-184781730)) - Fix validation of very large base64 strings ([#503](https://github.com/chriso/validator.js/pull/503)) diff --git a/README.md b/README.md index 81d551a8a..c13ed9c51 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,18 @@ var validator = require('validator'); validator.isEmail('foo@bar.com'); //=> true ``` +#### ES6 + +```javascript +import validator from 'validator'; +``` + +Or, import only a subset of the library: + +```javascript +import isEmail from 'validator/lib/isEmail'; +``` + ### Client-side usage The library can be loaded either as a standalone script, or through an [AMD][amd]-compatible loader @@ -33,12 +45,10 @@ $ bower install validator-js ### Strings only -This library validates and sanitizes strings only. - -**Repeat: this library validates and sanitizes strings only**. +**This library validates and sanitizes strings only.** -Passing input that isn't a string will be an error in an upcoming release. If you're not sure if your input is a string, coerce it using `input + ''`. +Passing anything other than a string is an error. ### Validators @@ -168,4 +178,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [bower]: http://bower.io/ [mongoid]: http://docs.mongodb.org/manual/reference/object-id/ -[ISIN]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number \ No newline at end of file +[ISIN]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number