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

oro-functions

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oro-functions - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

425

CHANGELOG.md

@@ -1,34 +0,81 @@

## 2.0.3 / 2023-11-23
* Updated lib: `oro-functions-client` from `v2.1.1` to `v2.1.2`.
## 2.1.0 / 2024-03-09
## 2.0.2 / 2023-11-22
* Fixed _github action_ `npm_publish_on_pr_merge_to_master`.
* Updated some _functions_:
* Updated `obtainingConfig`, `obtainOConfigSync` using by default the file `oconfig.json`.
* Added in console _process write_:
* consts `PROCESS_WRITE_COLORS`, `PROCESS_WRITE_COLOR_NUMBER`, `PROCESS_WRITE_BACKGROUND_NUMBER`.
* types `ProcessWriteColorNumber`, `ProcessWriteBackgroundNumber`.
* Setted a deprecated some functions:
* `obtainOroConfig`, use `obtainOConfig` with `oconfig.json` as default file instead.
* `obtainOroConfigSync`, use `obtainOConfigSync` with `oconfig.json` as default file instead.
* `isPortAvailable`, use `isPortFree` instead.
* Fixed `let` by `const` when it's required.
* Added _coverage_ for testing.
* Added _watcher_ for coding.
* Improved _github cicd_ replacing `npm install` to `npm ci`.
* Improved `export` declarations in index files.
* Enhanced _linter_ adding some extensions.
* Enhanced _prettier_ adding import-sorter.
* Improved tests migrating every test to the same level as their source file.
* Enhanced testing to achieve the `~95%` of coverage (yay!).
* Updated libs:
* `fast-glob` from `v3.3.1` to `v3.3.2`.
* `oro-functions-client` from `v2.1.0` to `v2.1.1`.
* `fs-extra` from `v11.1.1` to `v11.2.0`.
* `get-port-please` from `^3.1.1` to `v3.1.2`.
* `oro-functions-client` from `v2.1.2` to `v2.2.0`.
* `zip-lib` from `v0.7.3` to `v1.0.0`.
* Updated _dev_ libs:
* `@babel/core` from `v7.23.2` to `v7.23.3`.
* `@babel/preset-env` from `v7.23.2` to `v7.23.3`.
* `@babel/preset-typescript` from `v7.23.2` to `v7.23.3`.
* `@types/atob` from `v2.1.3` to `v2.1.4`.
* `@types/fs-extra` from `v11.0.3` to `v11.0.4`.
* `@types/jest` from `v29.5.7` to `v29.5.10`.
* `@typescript-eslint/eslint-plugin` from `v6.9.1` to `v6.12.0`.
* `@typescript-eslint/parser` from `v6.9.1` to `v6.12.0`.
* `eslint` from `v8.52.0` to `v8.54.0`.
* `prettier` from `v3.0.3` to `v3.1.0`.
* `tsup` from `v7.2.0` to `v8.0.1`.
* `@babel/core` from `v7.23.3` to `v7.23.9`.
* `@babel/preset-env` from `v7.23.3` to `v7.23.9`.
* `@types/jest` from `v29.5.10` to `v29.5.12`.
* `@typescript-eslint/eslint-plugin` from `v6.12.0` to `v7.0.2`.
* `@typescript-eslint/parser` from `v6.12.0` to `v7.0.2`.
* `eslint` from `v8.54.0` to `v^8.57.0`.
* `eslint-plugin-unicorn` from `v49.0.0` to `v50.0.1`.
* `husky` from `v8.0.3` to `v9.0.11`.
* `prettier` from `v3.1.0` to `v3.2.5`.
* `tsup` from `v8.0.1` to `v8.0.2`.
* `typescript` from `v5.2.2` to `v5.3.3`.
* Added _dev_ libs:
* `@trivago/prettier-plugin-sort-imports`
* `eslint-plugin-jest-formatting`
* `eslint-config-prettier`
* `eslint-plugin-jest`
* `nodemon`
## 2.0.3 / 2023-11-23
- Updated lib: `oro-functions-client` from `v2.1.1` to `v2.1.2`.
## 2.0.2 / 2023-11-22
- Fixed _github action_ `npm_publish_on_pr_merge_to_master`.
- Updated libs:
- `fast-glob` from `v3.3.1` to `v3.3.2`.
- `oro-functions-client` from `v2.1.0` to `v2.1.1`.
- Updated _dev_ libs:
- `@babel/core` from `v7.23.2` to `v7.23.3`.
- `@babel/preset-env` from `v7.23.2` to `v7.23.3`.
- `@babel/preset-typescript` from `v7.23.2` to `v7.23.3`.
- `@types/atob` from `v2.1.3` to `v2.1.4`.
- `@types/fs-extra` from `v11.0.3` to `v11.0.4`.
- `@types/jest` from `v29.5.7` to `v29.5.10`.
- `@typescript-eslint/eslint-plugin` from `v6.9.1` to `v6.12.0`.
- `@typescript-eslint/parser` from `v6.9.1` to `v6.12.0`.
- `eslint` from `v8.52.0` to `v8.54.0`.
- `prettier` from `v3.0.3` to `v3.1.0`.
- `tsup` from `v7.2.0` to `v8.0.1`.
## 2.0.1 / 2023-11-03
* Fixed typescript output definition of _fn_ `getFileJsonRecursively`, `getFileJsonRecursivelySync` to simplify their use (removing `{}`).
* Updated _dev_ libs:
* `@types/jest` from `v29.5.6` to `v29.5.7`.
* `@typescript-eslint/eslint-plugin` from `v6.9.0` to `v6.9.1`.
* `@typescript-eslint/parser` from `v6.9.0` to `v6.9.1`.
* `eslint-plugin-unicorn` from `v48.0.1` to `v49.0.0`.
* Deleted non-use _dev_ libs:
* `@types/crypto-js`.
* `@types/express`.
* `@types/lodash.clonedeep`.
- Fixed typescript output definition of _fn_ `getFileJsonRecursively`, `getFileJsonRecursivelySync` to simplify their use (removing `{}`).
- Updated _dev_ libs:
- `@types/jest` from `v29.5.6` to `v29.5.7`.
- `@typescript-eslint/eslint-plugin` from `v6.9.0` to `v6.9.1`.
- `@typescript-eslint/parser` from `v6.9.0` to `v6.9.1`.
- `eslint-plugin-unicorn` from `v48.0.1` to `v49.0.0`.
- Deleted non-use _dev_ libs:
- `@types/crypto-js`.
- `@types/express`.
- `@types/lodash.clonedeep`.
## 2.0.0 / 2023-10-27

@@ -40,256 +87,318 @@

* Added method `osIsAndroid`.
* Updated method `isPortFree` adding a second param `host` (by default `localhost`) to check specific port.
* Updated method `getPortFree` adding a third param `host` (by default `localhost`) to get free port.
* Refactored `*.js` to `src/*.ts`.
* Improved _typescript output declarations_.
* Updated _package_ as `type: "module"`.
* Added `tsup` and now _package_ is compiled to `cjs` _(common)_ and `mjs` _(module)_.
* Added _github actions_:
* `validate_pr_to_master`
* `npm_publish_on_pr_merge_to_master`.
* Added `husky` (to ensure only valid commits).
* Added `eslint` (and applied it).
* Added `prettier` (and applied it).
* Updated _package description_
* Updated libs:
* `fast-glob` to `v3.3.1`
* `get-port-please` to `v3.1.1`
* `oro-functions-client` to `v2.1.0`
* Updated _dev_ libs:
* `@babel/core` to `v7.23.2`.
* `@babel/preset-env` to `v7.23.2`.
* `@babel/preset-typescript` to `v7.23.2`.
* `@types/express` to `4.17.20`
* `@types/jest` to `v29.5.6`.
* `babel-jest` to `v29.7.0`.
* `jest` to `v29.7.0`.
- Added method `osIsAndroid`.
- Updated method `isPortFree` adding a second param `host` (by default `localhost`) to check specific port.
- Updated method `getPortFree` adding a third param `host` (by default `localhost`) to get free port.
- Refactored `*.js` to `src/*.ts`.
- Improved _typescript output declarations_.
- Updated _package_ as `type: "module"`.
- Added `tsup` and now _package_ is compiled to `cjs` _(common)_ and `mjs` _(module)_.
- Added _github actions_:
- `validate_pr_to_master`
- `npm_publish_on_pr_merge_to_master`.
- Added `husky` (to ensure only valid commits).
- Added `eslint` (and applied it).
- Added `prettier` (and applied it).
- Updated _package description_
- Updated libs:
- `fast-glob` to `v3.3.1`
- `get-port-please` to `v3.1.1`
- `oro-functions-client` to `v2.1.0`
- Updated _dev_ libs:
- `@babel/core` to `v7.23.2`.
- `@babel/preset-env` to `v7.23.2`.
- `@babel/preset-typescript` to `v7.23.2`.
- `@types/express` to `4.17.20`
- `@types/jest` to `v29.5.6`.
- `babel-jest` to `v29.7.0`.
- `jest` to `v29.7.0`.
## 1.3.2 / 2023-06-19
* Improved _readme_ (`SResponseOK`, `SResponseKO`).
- Improved _readme_ (`SResponseOK`, `SResponseKO`).
## 1.3.1 / 2023-06-17
* Fixed bad declared `import` from `process-write`.
- Fixed bad declared `import` from `process-write`.
## 1.3.0 / 2023-06-17
* Added `TS` support.
* Added _ts tests_.
* Improved _tests_.
* Improved _readme_.
* Updated lib `fast-glob` to `v3.2.12`.
* Updated lib `fs-extra` to `v11.1.1`.
* Updated lib `get-port-please` to `v3.0.1`.
* Updated lib `oro-functions-client` to `v1.5.4`.
* Updated lib-dev `jest` to `v29.5.0`.
* Renamed fns `obtainOConfig`, `obtainOConfigSync`, `isPortFree`
and deprecated `obtainOroConfig`, `obtainOroConfigSync`, `isPortAvailable`.
* Allow to get functions individually in `/src`:
* `const { fn1, fn2, ... } = require( 'oro-functions/src' )` (including 'oro-functions-client')
- Added `TS` support.
- Added _ts tests_.
- Improved _tests_.
- Improved _readme_.
- Updated lib `fast-glob` to `v3.2.12`.
- Updated lib `fs-extra` to `v11.1.1`.
- Updated lib `get-port-please` to `v3.0.1`.
- Updated lib `oro-functions-client` to `v1.5.4`.
- Updated lib-dev `jest` to `v29.5.0`.
- Renamed fns `obtainOConfig`, `obtainOConfigSync`, `isPortFree`
and deprecated `obtainOroConfig`, `obtainOroConfigSync`, `isPortAvailable`.
- Allow to get functions individually in `/src`:
- `const { fn1, fn2, ... } = require( 'oro-functions/src' )` (including 'oro-functions-client')
## 1.2.1 / 2022-08-16
* Updated lib `oro-functions-client` to `v1.4.1`.
- Updated lib `oro-functions-client` to `v1.4.1`.
## 1.2.0 / 2022-08-04
* Updated _Readme_ and `tests/`.
* Added `package-lock.json`.
* Changed lib `find-free-port` to `get-port-please`.
* Updated lib `oro-functions-client` to `v1.4.0`.
* Updated lib-dev `jest` to `v28.1.3`.
- Updated _Readme_ and `tests/`.
- Added `package-lock.json`.
- Changed lib `find-free-port` to `get-port-please`.
- Updated lib `oro-functions-client` to `v1.4.0`.
- Updated lib-dev `jest` to `v28.1.3`.
## 1.1.7 / 2022-06-21
* Updated lib `oro-functions-client` to `v1.3.7`.
- Updated lib `oro-functions-client` to `v1.3.7`.
## 1.1.6 / 2022-06-21
* Updated lib `oro-functions-client` to `v1.3.6`.
* Updated lib-dev `jest` to `v28.1.01`.
- Updated lib `oro-functions-client` to `v1.3.6`.
- Updated lib-dev `jest` to `v28.1.01`.
## 1.1.5 / 2022-05-25
* Updated lib `fast-glob` to `v3.2.11`.
* Updated lib `fs-extra` to `v10.1.0`.
* Updated lib `oro-functions-client` to `v1.3.5`.
* Updated lib `zip-lib` to `v0.7.3`.
* Updated lib-dev `jest` to `v28.1.0`.
- Updated lib `fast-glob` to `v3.2.11`.
- Updated lib `fs-extra` to `v10.1.0`.
- Updated lib `oro-functions-client` to `v1.3.5`.
- Updated lib `zip-lib` to `v0.7.3`.
- Updated lib-dev `jest` to `v28.1.0`.
## 1.1.4 / 2022-03-10
* Updated lib `oro-functions-client` to `v1.3.4`.
- Updated lib `oro-functions-client` to `v1.3.4`.
## 1.1.3 & 1.1.2 / 2022-03-10
* Updated lib `oro-functions-client` to `v1.3.2`.
- Updated lib `oro-functions-client` to `v1.3.2`.
## 1.1.1 / 2021-12-28
* Updated lib `oro-functions-client` to `v1.3.1`.
- Updated lib `oro-functions-client` to `v1.3.1`.
## 1.1.0 / 2021-12-17
* Added _method_ `cryptoGenerateKeyPair` from `oro-functions-client` because it breaks in _front frameworks_ like `Vue`.
- Added _method_ `cryptoGenerateKeyPair` from `oro-functions-client` because it breaks in _front frameworks_ like `Vue`.
## 1.0.4 / 2021-12-14
* Updated lib `oro-functions-client` to `v1.2.1`.
- Updated lib `oro-functions-client` to `v1.2.1`.
## 1.0.3 / 2021-12-14
* Updated lib `oro-functions-client` to `v1.2.0`.
* Updated lib `jest` to `v27.4.5`.
- Updated lib `oro-functions-client` to `v1.2.0`.
- Updated lib `jest` to `v27.4.5`.
## 1.0.2 / 2021-12-07
* Updated lib `oro-functions-client` to `v1.1.0`.
- Updated lib `oro-functions-client` to `v1.1.0`.
## 1.0.1 / 2021-09-21
* Updated lib `oro-functions-client` to `v1.0.1`.
- Updated lib `oro-functions-client` to `v1.0.1`.
## 1.0.0 / 2021-08-23
* Added _unit testing_ `Jest`.
* Added `MIT License`.
* Added _package_ in `github.com` & `npmjs.com`.
* Added _methods_:
* `pathIsFolder`
* `processWrites`
* Updated _methods_:
* `globFiles` and `folderIsEmpty` has second param default `globArgs = {
dot: true,
unique: true,
onlyFiles: true,
ignore: [ "node_modules/**", ".zero/**" ]
}`.
* `zipFolder` change library from `zip-a-folder` to `zip-lib` and now is allowed to zip _folder_ or _file_.
- Added _unit testing_ `Jest`.
- Added `MIT License`.
- Added _package_ in `github.com` & `npmjs.com`.
- Added _methods_:
- `pathIsFolder`
- `processWrites`
- Updated _methods_:
- `globFiles` and `folderIsEmpty` has second param default `globArgs = {
dot: true,
unique: true,
onlyFiles: true,
ignore: [ "node_modules/**", ".zero/**" ]
}`.
- `zipFolder` change library from `zip-a-folder` to `zip-lib` and now is allowed to zip _folder_ or _file_.
## 0.13.1 / 2021-07-28
* Update `oro-functions-client` to `v0.23.2`.
- Update `oro-functions-client` to `v0.23.2`.
## 0.13.0 / 2021-07-20
* Added method `getPortFree`.
- Added method `getPortFree`.
## 0.12.0 / 2021-07-20
* Added method `isPortAvailable`.
- Added method `isPortAvailable`.
## 0.11.10 & 0.11.9 / 2021-07-07
* Update `oro-functions-client` to `v0.23.1`.
- Update `oro-functions-client` to `v0.23.1`.
## 0.11.8 / 2021-06-29
* Update `oro-functions-client` to `v0.22.0`.
- Update `oro-functions-client` to `v0.22.0`.
## 0.11.7 & 0.11.6 / 2021-06-28
* Update `oro-functions-client` to `v0.21.0`.
* Update `oro-functions-client` to `v0.20.1`.
- Update `oro-functions-client` to `v0.21.0`.
- Update `oro-functions-client` to `v0.20.1`.
## 0.11.5 / 2021-06-25
* Update `oro-functions-client` to `v0.20.0`.
- Update `oro-functions-client` to `v0.20.0`.
## 0.11.3-0.11.4 / 2021-06-18
* Update `oro-functions-client` to `v0.19.1`.
- Update `oro-functions-client` to `v0.19.1`.
## 0.11.2 / 2021-05-18
* Updated method `globFiles`, params `onlyFiles` and `ignore` now are arguments.
* Fixed method `folderIsEmpty`, using `globFiles` with `onlyFiles = false`.
- Updated method `globFiles`, params `onlyFiles` and `ignore` now are arguments.
- Fixed method `folderIsEmpty`, using `globFiles` with `onlyFiles = false`.
## 0.11.1 / 2021-05-18
* Update `oro-functions-client` to `v0.18.3`.
- Update `oro-functions-client` to `v0.18.3`.
## 0.11.0 / 2021-05-19
* Added method `zipFolder`.
* Added in `.gitignore` the file `test.js`.
- Added method `zipFolder`.
- Added in `.gitignore` the file `test.js`.
## 0.10.0 / 2021-05-19
* Added method `folderIsEmpty`.
- Added method `folderIsEmpty`.
## 0.9.10 / 2021-05-18
* Update `oro-functions-client` to `v0.18.2`.
- Update `oro-functions-client` to `v0.18.2`.
## 0.9.8 / 2021-05-18
* Update `oro-functions-client` to `v0.18.0`.
- Update `oro-functions-client` to `v0.18.0`.
## 0.9.7 / 2021-05-17
* Update `oro-functions-client` to `v0.17.0`.
- Update `oro-functions-client` to `v0.17.0`.
## 0.9.6 / 2021-05-17
* Update `oro-functions-client` to `v0.16.0`.
- Update `oro-functions-client` to `v0.16.0`.
## 0.9.5 / 2021-05-17
* Update `oro-functions-client` to `v0.15.0`.
- Update `oro-functions-client` to `v0.15.0`.
## 0.9.4 / 2021-05-14
* Update `oro-functions-client` to `v0.14.0`.
- Update `oro-functions-client` to `v0.14.0`.
## 0.9.3 / 2021-05-14
* Update `oro-functions-client` to `v0.13.0`.
- Update `oro-functions-client` to `v0.13.0`.
## 0.9.2 / 2021-05-13
* Update `oro-functions-client` to `v0.12.0`.
- Update `oro-functions-client` to `v0.12.0`.
## 0.9.1 / 2021-05-06
* Update `oro-functions-client` to `v0.11.0`.
- Update `oro-functions-client` to `v0.11.0`.
## 0.9.0 / 2021-05-04
* Added method `processWrite`.
- Added method `processWrite`.
## 0.8.1 / 2021-05-04
* Changed `param:oConfig` by `param:config` in methods `obtainOroConfig` and `obtainOroConfigSync`.
- Changed `param:oConfig` by `param:config` in methods `obtainOroConfig` and `obtainOroConfigSync`.
## 0.8.0 / 2021-05-04
* Added methods `obtainOroConfig` and `obtainOroConfigSync`.
* Updated methods `getFileJsonRecursively` and `getFileJsonRecursivelySync`, using `Ofn.mergeObjectsDeep` instead of `Object.asign`.
- Added methods `obtainOroConfig` and `obtainOroConfigSync`.
- Updated methods `getFileJsonRecursively` and `getFileJsonRecursivelySync`, using `Ofn.mergeObjectsDeep` instead of `Object.asign`.
## 0.7.9 / 2021-04-30
* Update `oro-functions-client` to `v0.10.1`.
- Update `oro-functions-client` to `v0.10.1`.
## 0.7.7 / 2021-04-30
* Update `oro-functions-client` to `v0.9.2`.
- Update `oro-functions-client` to `v0.9.2`.
## 0.7.5 / 2021-04-23
* Update `oro-functions-client` to `v0.9.0`.
- Update `oro-functions-client` to `v0.9.0`.
## 0.7.4 / 2021-04-22
* Update `oro-functions-client` to `v0.8.1`.
- Update `oro-functions-client` to `v0.8.1`.
## 0.7.3 / 2021-04-22
* Update `oro-functions-client` to `v0.8.0`.
- Update `oro-functions-client` to `v0.8.0`.
## 0.7.2 / 2021-04-22
* Update `oro-functions-client` to `v0.7.2`.
- Update `oro-functions-client` to `v0.7.2`.
## 0.7.1 / 2021-04-21
* Separate `oro-functions-client` from `oro-functions` to allow using the lib on _client-side_.
Note: `oro-functions` still doing the same, it has only the _server-side_ functions and extends the others from`oro-functions-client`.
- Separate `oro-functions-client` from `oro-functions` to allow using the lib on _client-side_.
Note: `oro-functions` still doing the same, it has only the _server-side_ functions and extends the others from`oro-functions-client`.
## 0.6.1 / 2021-04-21
* Update library `oro-regexp` to `v0.1.0`.
- Update library `oro-regexp` to `v0.1.0`.
## 0.6.0 / 2021-04-17
* Add method `sleep`.
- Add method `sleep`.
## 0.5.2 / 2021-04-15
* Fix method `sanitizePath` when `filepath` is not `string`.
- Fix method `sanitizePath` when `filepath` is not `string`.
## 0.5.1 / 2021-04-14
* Fix method `chunkStringByCharSize` when `str` is `number`.
- Fix method `chunkStringByCharSize` when `str` is `number`.
## 0.5.0 / 2021-04-12
* Add method `arraysIntersection`.
- Add method `arraysIntersection`.
## 0.4.0 / 2021-04-12
* Add method `getFunctionName`.
- Add method `getFunctionName`.
## 0.3.1 / 2021-04-12
* Fix no param *error* in `setResponseOK`.
- Fix no param _error_ in `setResponseOK`.
## 0.3.0 / 2021-04-08
* Add method `jsonize`.
- Add method `jsonize`.
## 0.2.4 / 2021-04-06
* Replicate method as *sync mode* `getFileJsonRecursivelySync`.
- Replicate method as _sync mode_ `getFileJsonRecursivelySync`.
## 0.2.3 / 2021-03-30
* Fixed folder of method `getFileJsonRecursively`.
- Fixed folder of method `getFileJsonRecursively`.
## 0.2.2 / 2021-03-29
* Added npm-atob to ensure method `jwkTokenDecode` on Windows.
- Added npm-atob to ensure method `jwkTokenDecode` on Windows.
## 0.2.1 / 2021-03-25
* Added methods `chunkStringByCharSize`.
- Added methods `chunkStringByCharSize`.
## 0.1.1 / 2021-03-24
* Fix tag *async* of `getFileJsonRecursively`.
- Fix tag _async_ of `getFileJsonRecursively`.
## 0.1.0 / 2021-03-24
* Added changelog.
* Added npm fs-extra.
* Added methods *async* `getFileJsonRecursively`.
- Added changelog.
- Added npm fs-extra.
- Added methods _async_ `getFileJsonRecursively`.

@@ -7,4 +7,9 @@ import { SResponseOKObject, SResponseKOObject, Ofn as Ofn$1 } from 'oro-functions-client';

type ProcessWriteColor = 'gray' | 'red' | 'green' | 'white' | 'yellow' | 'blue' | 'redlight' | 'bluelight';
type ProcessWriteBackground = ProcessWriteColor;
declare const PROCESS_WRITE_COLORS: readonly ["gray", "red", "green", "white", "yellow", "blue", "redlight", "bluelight"];
declare const PROCESS_WRITE_COLOR_NUMBER: readonly [90, 91, 92, 93, 93, 94, 95, 96];
declare const PROCESS_WRITE_BACKGROUND_NUMBER: readonly [100, 101, 102, 103, 103, 104, 105, 106];
type ProcessWriteColor = (typeof PROCESS_WRITE_COLORS)[number];
type ProcessWriteBackground = (typeof PROCESS_WRITE_COLORS)[number];
type ProcessWriteColorNumber = (typeof PROCESS_WRITE_COLOR_NUMBER)[number];
type ProcessWriteBackgroundNumber = (typeof PROCESS_WRITE_BACKGROUND_NUMBER)[number];
interface ProcessWriteObjectShort {

@@ -81,3 +86,9 @@ s: string;

declare function obtainOConfigSync<T extends Record<string, any> = OConfigDefaultParams>(args?: OConfigArgs): OConfigResponse<T>;
/**
* @deprecated use obtainOConfig with 'oconfig.json' as default file
*/
declare function obtainOroConfig<T extends Record<string, any> = OConfigDefaultParams>(args?: OConfigArgs): Promise<OConfigResponse<T>>;
/**
* @deprecated use obtainOConfigSync with 'oconfig.json' as default file
*/
declare function obtainOroConfigSync<T extends Record<string, any> = OConfigDefaultParams>(args?: OConfigArgs): OConfigResponse<T>;

@@ -127,2 +138,5 @@

declare function isPortFree(port: number, host?: string): Promise<IsPortFreeResponse>;
/**
* @deprecated use `isPortFree` instead
*/
declare function isPortAvailable(port: number): Promise<IsPortFreeResponse>;

@@ -157,2 +171,2 @@

export { type CryptoKeyPairError, type CryptoKeyPairObject, type CryptoKeyPairOptions, type CryptoKeyPairResponse, type CryptoKeyPairType, type GetPortFreeError, type GetPortFreeOptions, type GetPortFreeResponse, type GlobFilesOptions, type IsPortFreeError, type IsPortFreeResponse, type OConfigArgs, type OConfigDefaultParams, type OConfigError, type OConfigObject, type OConfigResponse, Ofn, type PortFreeObject, type ProcessWriteBackground, type ProcessWriteColor, type ProcessWriteObject, type ProcessWriteObjectShort, type ProcessWriteObjectSimple, type ProcessWriteObjectVerbose, type ZipFolderError, type ZipFolderObject, type ZipFolderResponse, cryptoGenerateKeyPair, Ofn as default, folderIsEmpty, getFileJsonRecursively, getFileJsonRecursivelySync, getPortFree, globFiles, isPortAvailable, isPortFree, jwkTokenDecode, obtainOConfig, obtainOConfigSync, obtainOroConfig, obtainOroConfigSync, osIsAndroid, osIsLinux, osIsMac, osIsWindows, osPlatform, pathIsFolder, processWrite, processWrites, zipFolder };
export { type CryptoKeyPairError, type CryptoKeyPairObject, type CryptoKeyPairOptions, type CryptoKeyPairResponse, type CryptoKeyPairType, type GetPortFreeError, type GetPortFreeOptions, type GetPortFreeResponse, type GlobFilesOptions, type IsPortFreeError, type IsPortFreeResponse, type OConfigArgs, type OConfigDefaultParams, type OConfigError, type OConfigObject, type OConfigResponse, Ofn, type PortFreeObject, type ProcessWriteBackground, type ProcessWriteBackgroundNumber, type ProcessWriteColor, type ProcessWriteColorNumber, type ProcessWriteObject, type ProcessWriteObjectShort, type ProcessWriteObjectSimple, type ProcessWriteObjectVerbose, type ZipFolderError, type ZipFolderObject, type ZipFolderResponse, cryptoGenerateKeyPair, Ofn as default, folderIsEmpty, getFileJsonRecursively, getFileJsonRecursivelySync, getPortFree, globFiles, isPortAvailable, isPortFree, jwkTokenDecode, obtainOConfig, obtainOConfigSync, obtainOroConfig, obtainOroConfigSync, osIsAndroid, osIsLinux, osIsMac, osIsWindows, osPlatform, pathIsFolder, processWrite, processWrites, zipFolder };

@@ -5,3 +5,5 @@ var __defProp = Object.defineProperty;

var __propIsEnum = Object.prototype.propertyIsEnumerable;
// istanbul ignore next
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
// istanbul ignore next
var __spreadValues = (a, b) => {

@@ -18,2 +20,3 @@ for (var prop in b || (b = {}))

};
// istanbul ignore next
var __async = (__this, __arguments, generator) => {

@@ -40,4 +43,7 @@ return new Promise((resolve, reject) => {

// src/ofn.ts
import { Ofn as OfnClient } from "oro-functions-client";
// src/console/process-write.ts
import { isObject, isArray, isString } from "oro-functions-client";
import { isArray, isObject, isString } from "oro-functions-client";
function processWrite(strOrObject, color, bg) {

@@ -105,3 +111,3 @@ const config = { s: "", c: void 0, b: void 0 };

import crypto from "crypto";
import { isObject as isObject2, cloneObject, setResponseOK, setResponseKO } from "oro-functions-client";
import { cloneObject, isObject as isObject2, setResponseKO, setResponseOK } from "oro-functions-client";
function cryptoGenerateKeyPair() {

@@ -152,5 +158,8 @@ return __async(this, arguments, function* (passphrase = "", options = {}) {

// src/files/folder-is-empty.ts
import { isObject as isObject4, isString as isString3, sanitizePath as sanitizePath2 } from "oro-functions-client";
// src/files/glob-files.ts
import fglob from "fast-glob";
import { isString as isString2, isArray as isArray2, isObject as isObject3, sanitizePath } from "oro-functions-client";
import { isArray as isArray2, isObject as isObject3, isString as isString2, sanitizePath } from "oro-functions-client";
function globFiles(_0) {

@@ -173,3 +182,2 @@ return __async(this, arguments, function* (folderPath, globArgs = {}) {

// src/files/folder-is-empty.ts
import { isString as isString3, isObject as isObject4, sanitizePath as sanitizePath2 } from "oro-functions-client";
function folderIsEmpty(_0) {

@@ -194,8 +202,8 @@ return __async(this, arguments, function* (folderPath, globArgs = {}) {

import {
isString as isString4,
isNumeric,
objIsEmpty,
getFilenameByPath,
getFolderByPath,
mergeObjectsDeep
isNumeric,
isString as isString4,
mergeObjectsDeep,
objIsEmpty
} from "oro-functions-client";

@@ -245,9 +253,9 @@ function getFileJsonRecursively(filenameOrPath, parentDeep = 0) {

// src/files/obtain-oro-config.ts
// src/files/obtain-oconfig.ts
import {
arrayGetUnique,
getFilenameByPath as getFilenameByPath2,
getFolderByPath as getFolderByPath2,
isArray as isArray3,
isObject as isObject5,
getFilenameByPath as getFilenameByPath2,
getFolderByPath as getFolderByPath2,
arrayGetUnique,
setResponseKO as setResponseKO2,

@@ -262,3 +270,3 @@ setResponseOK as setResponseOK2

const {
file = "oro-config.json",
file = "oconfig.json",
deep = 0,

@@ -277,3 +285,3 @@ defaultParams = ["environment", "projectname", "projectserver"],

]);
let config = yield getFileJsonRecursively(file, deep);
const config = yield getFileJsonRecursively(file, deep);
for (const param of params) {

@@ -294,3 +302,3 @@ if (!(param in config)) {

const {
file = "oro-config.json",
file = "oconfig.json",
deep = 0,

@@ -309,3 +317,3 @@ defaultParams = ["environment", "projectname", "projectserver"],

]);
let config = getFileJsonRecursivelySync(file, deep);
const config = getFileJsonRecursivelySync(file, deep);
for (const param of params) {

@@ -322,7 +330,7 @@ if (!(param in config)) {

return __async(this, arguments, function* (args = {}) {
return yield obtainOConfig(args);
return yield obtainOConfig(__spreadValues({ file: "oro-config.json" }, args));
});
}
function obtainOroConfigSync(args = {}) {
return obtainOConfigSync(args);
return obtainOConfigSync(__spreadValues({ file: "oro-config.json" }, args));
}

@@ -343,11 +351,5 @@

// src/files/zip-folder.ts
import fsExtra3 from "fs-extra";
import { isNully, isString as isString6, sanitizePath as sanitizePath3, setResponseKO as setResponseKO3, setResponseOK as setResponseOK3 } from "oro-functions-client";
import { archiveFile, archiveFolder } from "zip-lib";
import fsExtra3 from "fs-extra";
import {
isString as isString6,
isNully,
sanitizePath as sanitizePath3,
setResponseKO as setResponseKO3,
setResponseOK as setResponseOK3
} from "oro-functions-client";
function zipFolder(folderPath, zipPath) {

@@ -359,3 +361,3 @@ return __async(this, null, function* () {

let folderDirectory = sanitizePath3(folderPath);
let zipFile = isNully(zipPath) ? `${folderDirectory.slice(-1) === "/" ? folderDirectory.slice(0, -1) : folderDirectory}.zip` : zipPath;
const zipFile = isNully(zipPath) ? `${folderDirectory.slice(-1) === "/" ? folderDirectory.slice(0, -1) : folderDirectory}.zip` : zipPath;
if (!isString6(zipFile)) {

@@ -378,3 +380,3 @@ return setResponseKO3("zipFolder failed, param:zipPath is string required.");

}
let response = yield archiveFolder(folderDirectory, zipFile).then(() => setResponseOK3()).catch(
const response = yield archiveFolder(folderDirectory, zipFile).then(() => setResponseOK3()).catch(
(error) => setResponseKO3(`zipFolder ${error.toString()}`, {

@@ -389,3 +391,3 @@ folderPath: folderDirectory,

} else {
let response = yield archiveFile(folderDirectory, zipFile).then(() => setResponseOK3()).catch(
const response = yield archiveFile(folderDirectory, zipFile).then(() => setResponseOK3()).catch(
(error) => setResponseKO3(`zipFolder ${error.toString()}`, {

@@ -434,6 +436,6 @@ folderPath: folderDirectory,

import { getPort } from "get-port-please";
import { isNully as isNully2, isArray as isArray4, isNumeric as isNumeric2, setResponseKO as setResponseKO4, setResponseOK as setResponseOK4 } from "oro-functions-client";
import { isArray as isArray4, isNully as isNully2, isNumeric as isNumeric2, setResponseKO as setResponseKO4, setResponseOK as setResponseOK4 } from "oro-functions-client";
function getPortFree(portStart, portEnd, host = "localhost") {
return __async(this, null, function* () {
let opts = { host, random: true };
const opts = { host, random: true };
if (!isNully2(portEnd)) {

@@ -446,5 +448,3 @@ let start = Number(portStart);

if (!portStart || isArray4(portStart) || !isNumeric2(portStart)) {
return setResponseKO4(
`param:portStart must be a number when portEnd is enabled. portStart: ${portStart}`
);
return setResponseKO4(`param:portStart must be a number when portEnd is enabled. portStart: ${portStart}`);
}

@@ -510,3 +510,3 @@ start > end && ([start, end] = [end, start]);

import { checkPort } from "get-port-please";
import { isNumeric as isNumeric3, setResponseOK as setResponseOK5, setResponseKO as setResponseKO5 } from "oro-functions-client";
import { isNumeric as isNumeric3, setResponseKO as setResponseKO5, setResponseOK as setResponseOK5 } from "oro-functions-client";
function isPortFree(port, host = "localhost") {

@@ -529,4 +529,4 @@ return __async(this, null, function* () {

// src/urls/jwk-token-decode.ts
import atob from "atob";
import { isString as isString7 } from "oro-functions-client";
import atob from "atob";
function jwkTokenDecode(token) {

@@ -548,45 +548,45 @@ if (!isString7(token)) {

// src/index.ts
import { Ofn as OfnClient } from "oro-functions-client";
export * from "oro-functions-client";
import { Ofn } from "oro-functions-client";
var Ofn2 = class extends OfnClient {
// src/ofn.ts
var Ofn = class extends OfnClient {
};
// Urls
Ofn2.jwkTokenDecode = jwkTokenDecode;
Ofn.jwkTokenDecode = jwkTokenDecode;
// Crypto
Ofn2.cryptoGenerateKeyPair = cryptoGenerateKeyPair;
Ofn.cryptoGenerateKeyPair = cryptoGenerateKeyPair;
// Files
Ofn2.obtainOConfig = obtainOConfig;
Ofn2.obtainOConfigSync = obtainOConfigSync;
Ofn.obtainOConfig = obtainOConfig;
Ofn.obtainOConfigSync = obtainOConfigSync;
// @deprecated
Ofn2.obtainOroConfig = obtainOroConfig;
Ofn.obtainOroConfig = obtainOroConfig;
// @deprecated
Ofn2.obtainOroConfigSync = obtainOroConfigSync;
Ofn2.getFileJsonRecursively = getFileJsonRecursively;
Ofn2.getFileJsonRecursivelySync = getFileJsonRecursivelySync;
Ofn2.globFiles = globFiles;
Ofn2.folderIsEmpty = folderIsEmpty;
Ofn2.pathIsFolder = pathIsFolder;
Ofn2.zipFolder = zipFolder;
Ofn.obtainOroConfigSync = obtainOroConfigSync;
Ofn.getFileJsonRecursively = getFileJsonRecursively;
Ofn.getFileJsonRecursivelySync = getFileJsonRecursivelySync;
Ofn.globFiles = globFiles;
Ofn.folderIsEmpty = folderIsEmpty;
Ofn.pathIsFolder = pathIsFolder;
Ofn.zipFolder = zipFolder;
// Operating System
Ofn2.osPlatform = osPlatform;
Ofn2.osIsWindows = osIsWindows;
Ofn2.osIsMac = osIsMac;
Ofn2.osIsLinux = osIsLinux;
Ofn2.osIsAndroid = osIsAndroid;
Ofn.osPlatform = osPlatform;
Ofn.osIsWindows = osIsWindows;
Ofn.osIsMac = osIsMac;
Ofn.osIsLinux = osIsLinux;
Ofn.osIsAndroid = osIsAndroid;
// Ports
// @deprecated
Ofn2.isPortAvailable = isPortAvailable;
Ofn2.isPortFree = isPortFree;
Ofn2.getPortFree = getPortFree;
Ofn.isPortAvailable = isPortAvailable;
Ofn.isPortFree = isPortFree;
Ofn.getPortFree = getPortFree;
// Console
Ofn2.processWrite = processWrite;
Ofn2.processWrites = processWrites;
var src_default = Ofn2;
Ofn.processWrite = processWrite;
Ofn.processWrites = processWrites;
// src/index.ts
export * from "oro-functions-client";
import { Ofn as Ofn2 } from "oro-functions-client";
export {
Ofn2 as Ofn,
Ofn as OfnClient,
Ofn,
Ofn2 as OfnClient,
cryptoGenerateKeyPair,
src_default as default,
Ofn as default,
folderIsEmpty,

@@ -593,0 +593,0 @@ getFileJsonRecursively,

{
"name": "oro-functions",
"version": "2.0.3",
"version": "2.1.0",
"description": "The Class Ofn extends Ofn-client and includes additional static helper functions for: URLs, Files, Operating System.",

@@ -18,6 +18,11 @@ "type": "module",

"test": "jest",
"coverage": "jest --coverage",
"coverage:open": "node coverage.open.js",
"coverage-open": "jest --coverage & node coverage.open.js",
"lint": "eslint .",
"prettier": "prettier --write .",
"clean": "rm -R ./dist",
"clean:all": "rm -R ./dist ./node_modules",
"build": "tsup ./src/index.ts --format cjs,esm --dts --clean"
"build": "tsup ./src/index.ts",
"watch": "nodemon"
},

@@ -43,26 +48,31 @@ "keywords": [

"fast-glob": "^3.3.2",
"fs-extra": "^11.1.1",
"get-port-please": "^3.1.1",
"oro-functions-client": "^2.1.2",
"zip-lib": "^0.7.3"
"fs-extra": "^11.2.0",
"get-port-please": "^3.1.2",
"oro-functions-client": "^2.2.0",
"zip-lib": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-typescript": "^7.23.3",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/atob": "^2.1.4",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.10",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"babel-jest": "^29.7.0",
"eslint": "^8.54.0",
"eslint": "^8.57.0",
"eslint-config-alloy": "^5.1.2",
"eslint-plugin-unicorn": "^49.0.0",
"husky": "^8.0.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-unicorn": "^51.0.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"prettier": "^3.1.0",
"tsup": "^8.0.1",
"typescript": "^5.2.2"
"nodemon": "^3.1.0",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
}
}
# Oro Functions
* [Overview](#overview)
* [Installation](#installation)
* [Example](#example)
* [Methods](#methods)
- [Overview](#overview)
- [Installation](#installation)
- [Example](#example)
- [Methods](#methods)

@@ -14,3 +14,3 @@ ## Overview

Class `oro-functions` is extended from `oro-functions-client`.
Class `oro-functions` is extended from `oro-functions-client`.

@@ -49,2 +49,3 @@ If you want to know all fns, read **[oro-functions-client](https://github.com/oropesa/oro-functions-client/)**.

## Example:
```js

@@ -61,2 +62,3 @@ // cjs

also every method could be called individually:
```js

@@ -74,36 +76,43 @@ // cjs

* [Oro Functions Client](#oro-functions-client)
* [Extended Functions](#extended-functions)
<hr>
* [URLs](#urls)
* [Ofn.jwkTokenDecode()](#ofnjwktokendecode)
- [Oro Functions Client](#oro-functions-client)
- [Extended Functions](#extended-functions)
* [Crypto](#crypto)
* [Ofn.cryptoGenerateKeyPair()](#ofncryptogeneratekeypair)
- [URLs](#urls)
* [Files](#files)
* [await Ofn.obtainOConfig()](#await-ofnobtainoconfig)
* [Ofn.obtainOConfigSync()](#ofnobtainoconfigsync)
* [await Ofn.getFileJsonRecursively()](#await-ofngetfilejsonrecursively)
* [Ofn.getFileJsonRecursivelySync()](#ofngetfilejsonrecursivelysync)
* [await Ofn.globFiles()](#await-ofnglobfiles)
* [await Ofn.folderIsEmpty()](#await-ofnfolderisempty)
* [await Ofn.pathIsFolder()](#await-ofnpathisfolder)
* [await Ofn.zipFolder()](#await-ofnzipfolder)
- [Ofn.jwkTokenDecode()](#ofnjwktokendecode)
* [Operating System](#operating-system)
* [Ofn.osPlatform()](#ofnosplatform)
* [Ofn.osIsWindows()](#ofnosiswindows)
* [Ofn.osIsMac()](#ofnosismac)
* [Ofn.osIsLinux()](#ofnosislinux)
* [Ofn.osIsAndroid()](#ofnosisandroid)
- [Crypto](#crypto)
* [Ports](#ports)
* [await Ofn.isPortFree()](#await-ofnisportfree)
* [await Ofn.getPortFree()](#await-ofngetportfree)
- [Ofn.cryptoGenerateKeyPair()](#ofncryptogeneratekeypair)
* [Console](#console)
* [Ofn.processWrite()](#ofnprocesswrite)
* [Ofn.processWrites()](#ofnprocesswrites)
- [Files](#files)
- [await Ofn.obtainOConfig()](#await-ofnobtainoconfig)
- [Ofn.obtainOConfigSync()](#ofnobtainoconfigsync)
- [await Ofn.getFileJsonRecursively()](#await-ofngetfilejsonrecursively)
- [Ofn.getFileJsonRecursivelySync()](#ofngetfilejsonrecursivelysync)
- [await Ofn.globFiles()](#await-ofnglobfiles)
- [await Ofn.folderIsEmpty()](#await-ofnfolderisempty)
- [await Ofn.pathIsFolder()](#await-ofnpathisfolder)
- [await Ofn.zipFolder()](#await-ofnzipfolder)
- [Operating System](#operating-system)
- [Ofn.osPlatform()](#ofnosplatform)
- [Ofn.osIsWindows()](#ofnosiswindows)
- [Ofn.osIsMac()](#ofnosismac)
- [Ofn.osIsLinux()](#ofnosislinux)
- [Ofn.osIsAndroid()](#ofnosisandroid)
- [Ports](#ports)
- [await Ofn.isPortFree()](#await-ofnisportfree)
- [await Ofn.getPortFree()](#await-ofngetportfree)
- [Console](#console)
- [Ofn.processWrite()](#ofnprocesswrite)
- [Ofn.processWrites()](#ofnprocesswrites)
<hr>

@@ -119,2 +128,4 @@

<hr>
### URLs

@@ -125,2 +136,3 @@

#### Ofn.jwkTokenDecode()
```ts

@@ -131,6 +143,10 @@ jwkTokenDecode( token: string ) => string;

```js
Ofn.jwkTokenDecode( 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoib3JvcGVzYSIsImlhdCI6MTYyOTcxMzM2MywiZXhwIjoxNjI5NzIwNTYzfQ.2zL8FzvFQCtuqi0fFoby4QVCXSi2pWNS3bzCU53Vd4M' );
Ofn.jwkTokenDecode(
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoib3JvcGVzYSIsImlhdCI6MTYyOTcxMzM2MywiZXhwIjoxNjI5NzIwNTYzfQ.2zL8FzvFQCtuqi0fFoby4QVCXSi2pWNS3bzCU53Vd4M',
);
// -> '{"user":"oropesa","iat":1629713363,"exp":1629720563}'
```
<hr>
### Crypto

@@ -141,2 +157,3 @@

#### Ofn.cryptoGenerateKeyPair()
```ts

@@ -192,3 +209,3 @@ Ofn.cryptoGenerateKeyPair(

```js
await Ofn.cryptoGenerateKeyPair( 'example' )
await Ofn.cryptoGenerateKeyPair('example');
// {

@@ -201,15 +218,18 @@ // passphrase: 'example',

* **Default options**
- **Default options**
```js
options = {
type: 'rsa', // 'rsa', 'rsa-pss', 'dsa', 'ec', 'ed25519', 'ed448', 'x25519', 'x448', 'dh'.
modulusLength: 4096,
publicKeyEncodingType: 'spki', // 'pkcs1' (RSA only) or 'spki'.
publicKeyEncodingFormat: 'pem', // 'pem', 'der', or 'jwk'.
privateKeyEncodingType: 'pkcs8', // 'pkcs1' (RSA only), 'pkcs8' or 'sec1' (EC only).
privateKeyEncodingFormat: 'pem', // 'pem', 'der', or 'jwk'.
privateKeyEncodingCipher: 'aes-256-cbc', // 'aes-256-cbc', 'des-cbc-sha', 'rc4-128-md5', ...
}
type: 'rsa', // 'rsa', 'rsa-pss', 'dsa', 'ec', 'ed25519', 'ed448', 'x25519', 'x448', 'dh'.
modulusLength: 4096,
publicKeyEncodingType: 'spki', // 'pkcs1' (RSA only) or 'spki'.
publicKeyEncodingFormat: 'pem', // 'pem', 'der', or 'jwk'.
privateKeyEncodingType: 'pkcs8', // 'pkcs1' (RSA only), 'pkcs8' or 'sec1' (EC only).
privateKeyEncodingFormat: 'pem', // 'pem', 'der', or 'jwk'.
privateKeyEncodingCipher: 'aes-256-cbc', // 'aes-256-cbc', 'des-cbc-sha', 'rc4-128-md5', ...
};
```
<hr>
### Files

@@ -220,3 +240,5 @@

#### await Ofn.obtainOConfig()
#### Ofn.obtainOConfigSync()
```ts

@@ -242,3 +264,3 @@ await Ofn.obtainOConfig<T extends object = OConfigDefaultParams>

type OConfigResponse<T extends object = OConfigDefaultParams> =
type OConfigResponse<T extends object = OConfigDefaultParams> =
SResponse<

@@ -273,4 +295,4 @@ OConfigObject<T>, // as SResponseOK

Put yourself in this situation, you work with _Git_ and you create _modules_ or _projects_
that need the common file `.env` to use _custom variables_, with data about, i.e.,
Put yourself in this situation, you work with _Git_ and you create _modules_ or _projects_
that need the common file `.env` to use _custom variables_, with data about, i.e.,
connect to _dbs_, _users-passwords_, _dev-pro_ or other _envs_, _custom configs_.

@@ -280,3 +302,3 @@

````shell
```shell
- parent-folder/

@@ -288,8 +310,8 @@ ├─ project-1/ #git-project-1

└...
````
```
Instead of create _global variables_ in the system, or duplicate the file `.env`, you can centralize
Instead of create _global variables_ in the system, or duplicate the file `.env`, you can centralize
all data in `oro-config.json`.
This file, `oro-config.json`, could be in the same project and in the parent folders too,
This file, `oro-config.json`, could be in the same project and in the parent folders too,
in such a way that the _final json_ is merged and overwritten from the parent folders to the project.

@@ -299,3 +321,3 @@

````shell
```shell
- parent-folder/

@@ -310,7 +332,7 @@ ├─ project-1/

└...
````
```
Continuing, the `oro-config.json` files have the next data:
````js
```js
// oro-config.json of Parent Folder

@@ -339,3 +361,3 @@ {

}
````
```

@@ -379,3 +401,3 @@ Finally, the `json` result is:

* **Default args**
- **Default args**

@@ -386,5 +408,5 @@ ```js

deep: 0,
defaultParams: [ 'environment', 'projectname', 'projectserver' ],
extraParams: []
}
defaultParams: ['environment', 'projectname', 'projectserver'],
extraParams: [],
};
```

@@ -405,3 +427,5 @@

#### await Ofn.getFileJsonRecursively()
#### Ofn.getFileJsonRecursivelySync()
```ts

@@ -417,11 +441,11 @@ await Ofn.getFileJsonRecursively<T>

````shell
```shell
- main/
├─ folder/
│ ├─ subfolder/
│ │ ├─ index.js
│ │ └─ custom.json
│ └ custom.json
└ custom.json
````
│ │ ├─ index.js
│ │ └─ custom.json
│ └ custom.json
└ custom.json
```

@@ -432,4 +456,4 @@ The _final json_ is merged and overwritten from the parents to the project file.

// in index.js
let custom = await Ofn.getFileJsonRecursively( 'custom.json', 2 );
// { ... }
let custom = await Ofn.getFileJsonRecursively('custom.json', 2);
// { ... }
```

@@ -440,2 +464,3 @@

#### await Ofn.globFiles()
```ts

@@ -449,3 +474,3 @@ await Ofn.globFiles = (

```js
await Ofn.globFiles( `folder/*` );
await Ofn.globFiles(`folder/*`);
// [

@@ -457,6 +482,5 @@ // `folder/example.txt`,

* **Default args**
*
This function is a wrapper of [fast-glob](https://www.npmjs.com/package/fast-glob) with _default args_.
so `GlobFilesOptions` are the same as [fast-glob Options](https://www.npmjs.com/package/fast-glob#options-3)
- **Default args**
- This function is a wrapper of [fast-glob](https://www.npmjs.com/package/fast-glob) with _default args_.
so `GlobFilesOptions` are the same as [fast-glob Options](https://www.npmjs.com/package/fast-glob#options-3)

@@ -466,7 +490,7 @@ ```js

globArgs = {
dot: true,
unique: true,
onlyFiles: true,
ignore: [ "node_modules/**", ".zero/**" ]
}
dot: true,
unique: true,
onlyFiles: true,
ignore: ['node_modules/**', '.zero/**'],
};
```

@@ -477,2 +501,3 @@

#### await Ofn.folderIsEmpty()
```ts

@@ -486,6 +511,6 @@ await Ofn.folderIsEmpty = (

```js
await Ofn.folderIsEmpty( `folder/` ); // false
await Ofn.folderIsEmpty(`folder/`); // false
```
* **Default args**
- **Default args**

@@ -498,7 +523,7 @@ This function is a wrapper of [fast-glob](https://www.npmjs.com/package/fast-glob) with _default args_.

globArgs = {
dot: true,
unique: true,
onlyFiles: true,
ignore: [ "node_modules/**", ".zero/**" ]
}
dot: true,
unique: true,
onlyFiles: true,
ignore: ['node_modules/**', '.zero/**'],
};
```

@@ -509,2 +534,3 @@

#### await Ofn.pathIsFolder()
```ts

@@ -515,3 +541,3 @@ await Ofn.pathIsFolder = ( folderPath: string ) => Promise<boolean>;

```js
await Ofn.pathIsFolder( `folder` );
await Ofn.pathIsFolder(`folder`);
// -> true

@@ -523,2 +549,3 @@ ```

#### await Ofn.zipFolder()
```ts

@@ -558,3 +585,3 @@ await Ofn.zipFolder = ( folderPath: string, zipPath?: string ) => Promise<ZipFolderResponse>;

```js
await Ofn.zipFolder( `folder`, 'folder.zip' );
await Ofn.zipFolder(`folder`, 'folder.zip');
// -> { status: true, zipPath: 'folder.zip' }

@@ -567,3 +594,6 @@ ```

<hr>
#### Ofn.osPlatform()
```ts

@@ -574,3 +604,3 @@ Ofn.osPlatform = () => NodeJS.Platform;

```js
Ofn.osPlatform();
Ofn.osPlatform();
// -> 'win32' || 'darwin' || 'linux' || ...

@@ -582,2 +612,3 @@ ```

#### Ofn.osIsWindows()
```ts

@@ -595,2 +626,3 @@ Ofn.osIsWindows = () => boolean;

#### Ofn.osIsMac()
```ts

@@ -608,2 +640,3 @@ Ofn.osIsMac = () => boolean;

#### Ofn.osIsLinux()
```ts

@@ -621,2 +654,3 @@ Ofn.osIsLinux = () => boolean;

#### Ofn.osIsAndroid()
```ts

@@ -631,2 +665,4 @@ Ofn.osIsAndroid = () => boolean;

<hr>
### Ports

@@ -637,2 +673,3 @@

#### await Ofn.isPortFree()
```ts

@@ -670,3 +707,3 @@ await Ofn.isPortFree = ( port: number ) => Promise<IsPortFreeResponse>;

```js
await Ofn.isPortFree( 3000 );
await Ofn.isPortFree(3000);
// -> { status: true, port: 3000 }

@@ -678,4 +715,5 @@ ```

#### await Ofn.getPortFree()
```ts
await Ofn.getPortFree = ( portStart?: number | number[], portEnd?: number )
await Ofn.getPortFree = ( portStart?: number | number[], portEnd?: number )
=> Promise<GetPortFreeResponse>;

@@ -726,13 +764,13 @@

```js
await Ofn.getPortFree();
await Ofn.getPortFree();
// -> { status: true, port: 60247 } #random
await Ofn.getPortFree( 3000 );
await Ofn.getPortFree(3000);
// -> { status: true, port: 3000 } #if not allowed, return random
await Ofn.getPortFree( [ 3000, 3001, 3002 ] );
await Ofn.getPortFree([3000, 3001, 3002]);
// -> { status: true, port: 3000 }
// -> { status: false, error: { msg: 'No available ports in array [ 3000, 3001, 3002 ]' } }
await Ofn.getPortFree( 3000, 3100 );
await Ofn.getPortFree(3000, 3100);
// -> { status: true, port: 3000 }

@@ -742,2 +780,4 @@ // -> { status: false, error: { msg: 'No available ports in range 3000-3100' } }

<hr>
### Console

@@ -748,2 +788,3 @@

#### Ofn.processWrite()
```js

@@ -763,10 +804,10 @@ Ofn.processWrite(

```js
Ofn.processWrite( 'info', 'blue' );
Ofn.processWrite( ' Doing some stuff... ' );
Ofn.processWrite('info', 'blue');
Ofn.processWrite(' Doing some stuff... ');
Ofn.processWrite( { s: 'Error!', c: 'red', b: 'redlight' } );
Ofn.processWrite( '\n' );
Ofn.processWrite({ s: 'Error!', c: 'red', b: 'redlight' });
Ofn.processWrite('\n');
```
* **Example:**
- **Example:**

@@ -777,17 +818,17 @@ ![Example Console - Process Write](https://oropensando.com/extrafiles/oro-functions/console-process-write.png)

* **Allowed Object:**
* `s`, `str`, or `string`
* `c`, `cl`, or `color`
* `b`, `bg`, or `background`
- **Allowed Object:**
- `s`, `str`, or `string`
- `c`, `cl`, or `color`
- `b`, `bg`, or `background`
* **Allowed Colors and Background:**
* `gray`
* `red`
* `green`
* `white`
* `yellow`
* `blue`
* `redlight`
* `bluelight`
- **Allowed Colors and Background:**
- `gray`
- `red`
- `green`
- `white`
- `yellow`
- `blue`
- `redlight`
- `bluelight`

@@ -797,2 +838,3 @@ <hr>

#### Ofn.processWrites()
```js

@@ -808,12 +850,12 @@ Ofn.processWrites( arr: Array<string | ProcessWriteObject> ) => string;

```js
Ofn.processWrites( [
{ s: ' info ', c: 'blue', b: 'bluelight' },
Ofn.processWrites([
{ s: ' info ', c: 'blue', b: 'bluelight' },
' Doing some stuff... ',
{ s: 'Error!', c: 'red', b: 'redlight' },
'\n'
] );
{ s: 'Error!', c: 'red', b: 'redlight' },
'\n',
]);
```
* **Example:**
- **Example:**
![Example Console - Process Writes](https://oropensando.com/extrafiles/oro-functions/console-process-writes.png)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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