New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cc-utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-utils

Utils

latest
Source
npmnpm
Version
1.0.18
Version published
Weekly downloads
18
Maintainers
1
Weekly downloads
 
Created
Source

Code Craft - Utils

INSTALLING

via npm

  • npm install cc-utils

from source

  • git clone https://bitbucket.org/FinoCodeLab/cc-utils.git

HOW IS IT USED?

const Utils = require('cc-utils');
Utils.capitalizeFirstLetter('hello');
// Or
const { handlePagination } = require('cc-utils');
const { skip, limit } = handlePagination({ page: 1, limit: 20 })
// mongo example (mongoose)
const itemList =  Item.find({}).skip(skip).limit(limit);

AVAILABLE METHODS

MethodsParamsReturn
convertConstantToArrayobjArray
convertSpecificToObjectobj, idObject
convertObjectToArrayobjArray
listObjectToSimplelist, keyArray
strReplaceAllstr, replace, byString
isBase64textBoolean
setAsObjectdataObject
orderJsonobjObject
randomStringlengthString
capitalizeFirstLetterstringString
generateIdlengthNumber Int
handlePagination{ page, limit}Number Int
uniquearrayArray
currencyNumber, objectNumber
parseCurrency(Number/String), ObjectArray

Descriptions

  • generateId: @param length (Int):return a String as long as length param

  • handlePagination: @param options Object { page: Int, limit: Int}: return an object with skip and limit properties. This is for mongo queries.

  • unique: @param array Array | return and array with uniques values.

  • currency: @params value: Number, options: Object | return formatted Number

  • parseCurrency: @params value: Number or String, options: Object | return formatted Number. Extension for format-currency

Keywords

cc

FAQs

Package last updated on 15 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts