# central-js

> Central Library for JS

Latest version **1.0.4** (published 2022-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install central-js
pnpm add central-js
yarn add central-js
bun add central-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-09-02 |
| First published | 2022-08-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 22.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Flavio Rosselli |
| Maintainers | rosselli |
| Keywords | date and time, http response, Percentage and Rule of three, read and write files, time conversion |

## Links

- npm: https://www.npmjs.com/package/central-js
- Repository: https://gitlab.com/rosselli-public/central-js
- Homepage: https://gitlab.com/rosselli-public/central-js#readme
- Issues: https://gitlab.com/rosselli-public/central-js/issues
- npm.io page: https://npm.io/package/central-js

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-09-02
- 1.0.3 — 2022-09-02
- 1.0.2 — 2022-08-28
- 1.0.1 — 2022-08-21
- 1.0.0 — 2022-08-20

## README

# 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

---
_Source: https://npm.io/package/central-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
