npm.io
1.0.4 • Published 4 years ago

central-js

Licence
ISC
Version
1.0.4
Deps
0
Size
22 kB
Vulns
0
Weekly
0

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 1616
  • 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 0200
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 0230

Keywords