Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Aleppo is lightweight package written in javascript. It's toolbox contains general collection functions for node.
clone the repo:
git clone git@github.com:jimmy02020/aleppo.git
cd aleppo
npm
$ npm install aleppo
isUn(...inputs) //tests for undefineds.
isNull(...inputs) //tests for nulls.
isValid(...inputs) //tests for not being undefineds or nulls.
isObj(...inputs) //tests for objects.
isBool(...inputs) //tests for Booleans.
isNum(...inputs) //tests for numbers.
isStr(...inputs) //tests for strings.
isFn(...inputs) //tests for functions.
isSymb(...inputs) //tests for symbols.
isArr(...inputs) //tests for arrays.
isZeroLength(...inputs) //tests for zero length.
isStrEmpty(...inputs) //tests if strings are empty.
isArrEmpty(...inputs) //tests if arrays are empty.
IS-functions can deal with one argument or multiple arguments.
//example
isZeroLength('hi', 'test', 'i am here'); // returns false.
isNum(1,2,4,5,7,8,1000); // returns true.
import doo from 'aleppo'
doo.iterator([...funcs],[...args]) //returns iterator object of results.
doo.array([...funcs],[...args]) //returns array of results.
doo.object([...funcs],[...args]) //returns array of objects [{func: 'Function name', result: 'result of the function'}]
import generators from 'aleppo'
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'.
import getters from 'aleppo'
object: returns key and prop for unknown input.
// getters.obj(object)
// example:
const test = { foo: 'bar' };
getters.obj(test); // will return: key = foo, prop = bar
delay: calculates delay time according to given option.
// getters.delay(option)
// example
getters.delay('1h') // 3600000.
getters.delay('10m') + Date.now() // returns time after ten minutes in milliseconds
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/month/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.date: deals with time and date, in readable form.
const date = getter.date
year/years/yrs/yyyy
: full year/ four digits.y/yy/yyy
: two digits year.mo/mos
: month in number.mth/mths
: month short name.month/months
: month full name.w/wk/week/weeks
: week number.d
: day number in the week.dd
: day short name.day/days
: day full name.h/hr/hrs/hour/hours/h24/hr24/hrs24/hour24/hours24
: 24-hour form.h12/hr12/hrs12/hour12/hours12
: 12-hour form.m/min/mins/minute/minutes
: minutes.s/sec/secs/second/seconds
: seconds.ms/mili/milisec/milisecs/milisecond/miliseconds
: milliseconds.ts/timestamp
: timestamp. (available only for now function)blocal
: local date and time. (available only for now function)local date/localDate
: local date.(available only for now function)local time/localTime
: local time. (available only for now function)'-' or '/' or'.' or':' or ' '
: separators accepted for multiple request (available only for now function)Examples:
const date = getter.date
date.now('ts') // return current timestamp 1495989532977.
date.now('hr:day:mo:week')// returns current required form 18:Sunday:5:21
date.now('year:day:week:month:second') // returns 2017:Sunday:21:May:52
date.later('40days') // returns Friday. It will be Friday after 40 days from now.
date.later('10months') // returns March. It will be March after 10 months from now.
date.later('12weeks', 'ts') // returns timestamp 1503247132981 after 12weeks from now.
date.later('30months', 'full date') // returns object with full time. Calculates 30 months form now.
// { year: 2019, month: 11, day: 27, hr: 6, min: 39, sec: 27 }
date.ago('2years') // returns 2015. 2 years ago from now.
date.ago('20hr12', 'ts') // returns timestamp for 20 hours ago form now. 1503247105430
date.ago('8min', 'full date') // returns full date of 8 minutes ago from now. { year: 2019, month: 11, day: 27, hr: 6, min: 38, sec: 59 }
date.readTs(1503247105430) // { year: 2017, month: 8, day: 20, hr: 18, min: 38, sec: 25 }
date.isLeap(2028) // true
date.isCommon(2018) // true
date.yearType(2018) // common
full date/fullDate/f
for passing full date arguments to later or ago functions and it's optional.ts/timestamp
for passing timestampe argument to later or ago functions and it's optional as well.wait(option)
import wait from 'aleppo'
wait('20s').then(() => console.log('Hello!')); // 'Hello! will be printed after 20 seconds'
$ npm test
This project is licensed under the MIT License
FAQs
General node functions, useful for any project.
The npm package aleppo receives a total of 0 weekly downloads. As such, aleppo popularity was classified as not popular.
We found that aleppo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.