Noodles Practicing Medicine
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

whitelister

0.0.5 • Public • Published

Whitelister

Simple, dependency-free filtering and validation tool for Node.js.

Quick Start

Using npm:

npm i --save whitelister

In Node.js

const whitelister = require('whitelister');
 
const rules = {
  q: 'string',
  page: { type: 'integer', min: 1, default: 1 },
  per_page: { type: 'integer', min: 1, max: 100, default: 20 },
};
 
const params = { q: 'hello' };
 
return whitelister(rules, params);
// => { page: 1, per_page: 20, q: 'hello' };

Documentation

You can find the full documentation on the website: https://spireteam.github.io/whitelister/

License

MIT

Changelog

v0.0.4

Oct. 16, 2017

  • Ensure that type is treated like other attributes

Install

npm i whitelister

DownloadsWeekly Downloads

6

Version

0.0.5

License

MIT

Last publish

Collaborators

  • avatar