Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metautil

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metautil

Metarhia utilities

  • 3.5.9
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Metarhia utilities

ci status snyk npm version npm downloads/month npm downloads license

Usage

  • Install: npm install metautil
  • Require: const metautil = require('metautil');

Common utilities

  • random(min: number, max?: number): number
  • sample(arr: Array<any>): any
  • ipToInt(ip?: string): number
  • parseHost(host?: string): string
  • parseParams(params: string): object
  • replace(str: string, substr: string, newstr: string): string
  • split(s: string, separator: string): [string, string]
  • fileExt(fileName: string): string
  • between(s: string, prefix: string, suffix: string): string
  • isFirstUpper(s: string): boolean
  • toLowerCamel(s: string): string
  • toUpperCamel(s: string): string
  • isConstant(s: string): boolean
  • nowDate(date?: Date): string
  • duration(s: string | number): number
  • makePrivate(instance: object): object
  • protect(allowMixins: Array<string>, ...namespaces: Array<object>): void
  • parseCookies(cookie: string): object
  • createAbortController(): AbortController
  • timeout(msec: number, signal?: EventEmitter): Promise<void>
  • delay(msec: number, signal?: EventEmitter): Promise<void>

Crypto utilities

  • cryptoRandom(): number
  • generateKey(length: number, possible: string): string
  • crcToken(secret: string, key: string): string
  • generateToken(secret: string, characters: string, length: number): string
  • validateToken(secret: string, token: string): boolean
  • hashPassword(password: string): Promise<string>
  • validatePassword(password: string, serHash: string): Promise<boolean>

Async abstractions

  • new Semaphore(concurrency: number, size?: number, timeout?: number)

License & Contributors

Copyright (c) 2017-2021 Metarhia contributors. Metautil is MIT licensed.
Metautil is a part of Metarhia technology stack.

Keywords

FAQs

Package last updated on 27 Jul 2021

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