Noodles, Poodles and More!

    no-more-lies

    1.0.0 • Public • Published

    no-more-lies

    NPM version

    no-more-lies is a Javascript normaliser for user input from web forms, APIs, etc.

    Requirements

    Installation

    npm install no-more-lies

    Run Tests

    mocha

    Usage

    var NoMoreLies = require('no-more-lies');
     
    var noMoreLies = new NoMoreLies({
      name: 'string',
      username: {
        type: 'string',
        max: 20
      },
      age: 'int',
      postsPerPage: {
        type: 'int',
        min: 10,
        max: 50
      }
    });
     
    var normalised = noMoreLies.normalise({
      name: 123,
      username: 'averylonglonglongusername',
      age: '25',
      postsPerPage: '9'
    });
     
    /* normalised contains:
     
      {
        name: '123',
        username: 'averylonglonglonguse',
        age: 25,
        postsPerPage: 10
      }
     
    */

    Install

    npm i no-more-lies

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • aiham