Socket
Socket
Sign inDemoInstall

central-js

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    central-js

Central Library for JS


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Install size
22.5 kB
Created
Weekly downloads
 

Readme

Source

Central JS

Conversion

  • timeFromFFProbe(time) return {hours, minutes, seconds}

Date

  • parseDate() return { date: [ '2022', '09', '02' ], time: [ '16', '42', '16' ] }
  • now(showTime = false) return 2022.09.02 or 2022.09.02 16:42:16
  • nowSlug() return 2022-09-02-16-42-16
  • nowTimeStamp() return 1662136936955

Files

  • readJSON(filename)
  • readText(filename)
  • writeJSON(data, filename)
  • writeText(data, filename)
  • removeHiddenFiles(list)

Format

  • sizeUnits(bytes) return 10.1 MB
  • timeFromString(number) return 02:38:00

Percentage

  • findPercent(percentage, total, log = false)
  • findPercentage(part, total, log = false)
  • findTotal(part, percentage, log = false)

Response

  • format(code, data) return { code: 502, message: 'Bad Gateway', data: { name: 'Flavio' } }

Rule Of Three

  • acb(a, b, c, log = false)
  • bca(a, b, c, log = false)
  • inverse(a, b, c, log = false)

Runner

  • runBashCommand(command, output = false)

String

  • timeAddZero(hours, minutes, seconds) return 02:07:30

Keywords

FAQs

Last updated on 02 Sep 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc