mybase
v1.1.44
Published
adding them slowly to the project ``` import { utcnow } from 'mybase/ts' // types import { UnixtimeShort } from 'mybase/ts/types' ```
Downloads
1,074
Readme
Typescript support is being added
adding them slowly to the project
import { utcnow } from 'mybase/ts'
// types
import { UnixtimeShort } from 'mybase/ts/types'
mybase
var { isLocal } = require('mybase')
Methods
vaultRead(vaultHandle,key) <Promise>
: Reads Vault Key
vaultFill(vaultHandle,obj,ignoreError=false) <Promise>
canReadAndWrite(path,create-false) <Promise>
randomString(length=10,charSet='..')
randomBase32(length=10)
getTemp(filename=false) // returns temp directory of current OS, optionally appends a filename to it
softexit(message=false,seconds=60,exitcode=-1)
validHPassword(hpassword)
randomHPassword(length=10)
isURL(string)
validIp(ip)
validTime(t)
randomIP()
validEmail(email)
validUUID4(uuid) : boolean
validHostname(hostname)
validURL(url)
vaultRead(vault,key) :
removeDoubleSlashes(url) : string - removes double slashes
isLocal()
object_shuffle(object)
array_shuffle(array)
isMochaRunning
ip2int(), int2ip()
ensureProperty(obj,'tier.tier',defaultValue)
Geoip2Paths() : boolean | object
arrayRandomItem(array,defaultValue=false)
maxmindOpen(geoipFile) :
utcnow():int
Encryption
decryptAES_CBC_NOIV(encryptedHex, encryptionKey)
encryptAES_CBC_NOIV(plainString, encryptionKey)
hash_sha512(plain)
isReservedLANIP(address4_or_6)
isLANIp(address4_or_6)
isLoopbackIP(address4_or_6)
var handle = await maxmindOpen(config.geoip.country)