@switchless-io/util
helpers and middleware functions for node, express based framework
Last updated a month ago by aptro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @switchless-io/util 
SYNC missed versions from official npm registry.

Modules

@switchless/util

Helper and middleware function for node and express based apps.

helper
middleware

@switchless/util

Helper and middleware function for node and express based apps.

Example
Installation

npm install @switchless-io/util

Usage

const switchlessUtil = require('@switchless/util')

helper

switchlessUtil.helper.formatNumber(number, number_format, precision) ⇒ string

number - the number to be formatted number_format - what format do you want the number to be formatted in. precision - if the number has decimals, then what precision do you want to show

egs of number format

  • indian_thousand
  • indian_lakh
  • indian_crore
  • us_thousand
  • us_million
  • us_billion

precision - takes in any integer. Most commonly used - 1 or 2

Kind: static method of helper

Param Type
number *
number_format *
precision *

switchlessUtil.helper.logger(level) ⇒ object

Kind: static method of helper

Param Type
level string

middleware

switchlessUtil.middleware.requestLogger(req, res, next) ⇒ callback

Kind: static method of middleware

Param Type
req *
res *
next *

switchlessUtil.middleware.JWTAuth(secret) ⇒ function

Kind: static method of middleware

Param Type
secret *

switchlessUtil.middleware.sanitizeHTML(req, res, next) ⇒ callback

Kind: static method of middleware

Param Type
req *
res *
next *

switchlessUtil.middleware.rateLimit(redis_host) ⇒ function

Kind: static method of middleware

Param Type
redis_host string

Current Tags

  • 3.2.3                                ...           latest (a month ago)

3 Versions

  • 3.2.3                                ...           a month ago
  • 3.2.2                                ...           a month ago
  • 3.2.1                                ...           a month ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 31
Dependencies (10)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |