New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aleppo

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aleppo

General node functions, useful for any project.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-72.22%
Maintainers
1
Weekly downloads
 
Created
Source

Overview

Aleppo is lightweight package written in javascript. It's toolbox contains general collection functions for node.

Getting Started

clone the repo:

git clone git@github.com:jimmy02020/aleppo.git
cd aleppo

npm

$ npm install aleppo

Usage

IS: true or false functions

isUn(input) //tests for undefined.
isNull(input) //tests for null.
isValid(input) //tests for not being undefined or null.
isObj(input) //tests for object.
isBool(input) //tests for Boolean.
isNum(input) //tests for number.
isStr(input) //tests for string.
isFn(input) //tests for function.
isSymb(input) //tests for symbol.
isArr(input) //tests for array.
isZeroLength(input) //tests for zero length.
isStrEmpty(input) //tests if string is empty.
isArrEmpty(input) //tests if array is empty..

Generators:

  1. Numbers:
    const numbers = generators.numbers;
    
    numbers.getRandom(min, max, type) //returns random number in given range.
    // type: is string. By default will apply for integer random number. for arbitrary value just pass 'any'.
    

Getters:

  1. object:

    getters.obj(input) // returns key and prop.
    // param  = { foo: 'bar' };
    // will return key = foo and prop = bar throws error if  empty.
    
  2. delay:

    getters.delay(option) // returns delay time in microsecondsm according to given option.
    // getters.delay("10m") ==> 600000
    
    Types of options formats are:
    • y/year/years: returns delay in years.
    • d/day/days: returns delay in days.
    • h/hour/hours : returns delay in hours.
    • w/week/weeks: returns delay in weeks.
    • mo/mos/months : returns delay in months.
    • m/minute/minutes: returns delay in minutes.
    • s/second/seconds : returns delay in seconds.
    • ms/millisecond/milliseconds : returns delay in milliseconds.

wait:

wait(option).then(() => console.log('Hello!')) // returns promise.
// wait('20s').then(() => console.log('Hello!')); // 'Hello! will be printed after 20 seconds'
  • options allowed in wait are the same in delay function.

Tests

$ npm test

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 09 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc