# @wizzi/utils

> Utility library for the wizzi factory

Latest version **0.8.25** (published 2024-08-31) · 0 weekly downloads

## Install

```sh
npm install @wizzi/utils
pnpm add @wizzi/utils
yarn add @wizzi/utils
bun add @wizzi/utils
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.25 |
| Published | 2024-08-31 |
| First published | 2023-04-05 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=0.10.28 |
| Dependencies | 14 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stefano Bassoli |
| Maintainers | stfn.bssl |

## Links

- npm: https://www.npmjs.com/package/@wizzi/utils
- Repository: https://github.com/stfnbssl/wizzi
- Homepage: https://github.com/stfnbssl/wizzi#readme
- Issues: https://github.com/stfnbssl/wizzi/issues
- npm.io page: https://npm.io/package/@wizzi/utils

## Dependencies (14)

- [i](https://npm.io/package/i.md) ^0.3.7
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [async](https://npm.io/package/async.md) ^2.1.5
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [hashids](https://npm.io/package/hashids.md) latest
- [promise](https://npm.io/package/promise.md) ^7.1.1
- [fs-extra](https://npm.io/package/fs-extra.md) latest
- [extsprintf](https://npm.io/package/extsprintf.md) ^1.2.0
- [iconv-lite](https://npm.io/package/iconv-lite.md) ^0.4.15
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.11
- [randomstring](https://npm.io/package/randomstring.md) latest
- [@wizzi/helpers](https://npm.io/package/@wizzi/helpers.md) 0.8.2
- [json-stringify-safe](https://npm.io/package/json-stringify-safe.md) ^5.0.1

## Recent versions

- 0.8.25 (latest) — 2024-08-31
- 0.8.24 — 2024-07-03
- 0.8.23 — 2024-05-09
- 0.8.22 — 2024-05-06
- 0.8.21 — 2024-04-18
- 0.8.20 — 2024-04-17
- 0.8.19 — 2024-04-12
- 0.8.18 — 2024-04-12
- 0.8.17 — 2024-04-01
- 0.8.16 — 2024-04-01
- 0.8.15 — 2024-03-24
- 0.8.14 — 2024-03-14
- 0.8.13 — 2024-03-14
- 0.8.12 — 2024-03-13
- 0.8.11 — 2024-03-13
- … 11 more at https://npm.io/package/@wizzi/utils/versions

## README

# @wizzi/utils

Utility library for the wizzi factory




## Work still in progress

Availability of features will be announced

on [Twitter](https://twitter.com/wizziteam) and [Facebook](https://www.facebook.com/wizzifactory)


## vfile - virtual file system
#### var vfile = require('@wizzi/utils').vfile
### vfileInst - create a virtual file system instance
#### var vfileInst = vfile([fsimpl])
    * `fsimpl` `Object` Default: NodeJS fs object or fs-graceful if available. 
### vfileInst.read(path_string, options[, callback])
    * `path_string` 
    * `options` `Object` 
    * `callback` `Function` If absent the call is sync. * `err` 
        * `content` 
    
### vfileInst.write(path_string, content, options[, callback])
    * `path_string` 
    * `content` `String` 
    * `options` `Object` 
    * `callback` `Function` If absent the call is sync. When the call is sync if `fsimpl` does not implement `readFileSync` throw Error.
    
        * `err` 
        * `content` 
    
### vfileInst.readJSON(path_string, options[, callback])
### vfileInst.writeJSON(path_string, obj, options[, callback])
## The `fsimpl` - interface

<p>This interface must be implemented by file system objectsthat expose their documents to the wizzi factory.
</p>


<p>The `Sync` methods are optional, but a `Sync` call to anfsimpl that does not implement it throw an Error.
</p>

#### stat(path, callback)

<p>The returned `stats` object must implement: stats.isFile()stats.isDirectory()
</p>

#### statSync(path)

<p>The returned `stats` object must implement: stats.isFile()stats.isDirectory()
</p>

#### lstat(path, callback)

<p>The returned `stats` object must implement: stats.isFile()stats.isDirectory()
</p>

#### lstatSync(path)

<p>The returned `stats` object must implement: stats.isFile()stats.isDirectory()
</p>

#### readFile(path[, options], callback)
#### readFileSync(path[, options])
#### writeFile(path, content[, options], callback)
#### writeFileSync(path, content[, options])
#### readdir(path[, options], callback)
#### readdirSync(path[, options])
#### mkdir(path[, options], callback)
#### mkdirSync(path[, options])
## verify - helper object
#### var verify = require('@wizzi/utils').verify
## verify - type checks
#### verify.isDefined(item)
#### verify.isNullOrUndefined(item)
#### verify.isObject(item)
#### verify.isArray(item)
#### verify.isFunction(item)
#### verify.isNumber(item)
#### verify.isBoolean(item)
#### verify.isDate(item)
#### verify.isString(item)
#### verify.isEmpty(item)
#### verify.isNotEmpty(item)
#### verify.isPrimitive(item)
#### verify.isRegExp(item)
#### verify.isError(item)
#### verify.isAbsolutePath(item)
#### verify.isIttfMacro(item)
## verify.convert(value, type[, unquote])
    * `value` `String` If `@@null` return null; if `@@undefined` return undefined. 
    * `type` `String` One-of string, integer, float, boolean, date 
    * `options` `Object` 
## verify.canConvertTo(value, type)
    * `value` `String` 
    * `type` `String` One-of string, integer, float, boolean, date 
## verify - validations
#### verify.isEmail(value)
#### verify.isEmails(value)
#### verify.isMinLength(value, length)
#### verify.isMaxLength(value, length)
#### verify.isExactLength(value, length)
#### verify.isGreaterThan(value, test)
#### verify.isLessThan(value, test)
#### verify.isGreaterEqualThan(value, test)
#### verify.isLessEqualThan(value, test)
#### verify.isAlpha(value)
#### verify.isAlphaNumeric(value)
#### verify.isIp(value)
#### verify.isBase64(value)
#### verify.isUrl(value)
#### verify.isCreditCard(value)
#### verify.isGreaterThanDate(value, date)
#### verify.isLessThanDate(value, date)
#### verify.isGreaterEqualDate(value, date)
#### verify.isLessEqualDate(value, date)
## verify - errors
#### verify.error([inner,] [obj,] message, [arg-1[, arg-2[, arg-...]]])
#### verify.fatal(err[, code])
## folderScanner - ittf documents folder scanner
#### var folderScanner = require('@wizzi/utils').folderScanner
## folderScanner.scan(folderPath[, options])
    * `folderPath` `uri` 
    * `options` `Object` 
    * returns the root IttfFsNode of the 'folderPath' with its descendant folders as children. 
## ittfDocumentGraph - enhanced mTree with import, export, analize capabilities
#### var ittfDocumentGraph = require('@wizzi/utils').ittfDocumentGraph
#### ittfDocumentGraph.loadFrom(path_string)
    * `path_string` `uri` The uri of the ittf document that will be loaded as is (no composition, non template evaluation) 
    * returns an ittfDocumentGraph instance 
#### ittfDocumentGraph.loadFrom(mTree)
    * `mTree` `Object` An existent final or partial mTree. 
    * returns an ittfDocumentGraph instance 
## ittfHtmlPrettifier - ittf html formatter for documentation
#### var ittfHtmlPrettifier = require('@wizzi/utils').ittfHtmlPrettifier
## ittfHtmlPrettifier(rootNode[, options])
    * `rootNode` `Object` ittfDocumentGraph instance 
    * `options` `Object` 
## jsHtmlPrettifier - javascript html formatter for documentation
#### var jsHtmlPrettifier = require('@wizzi/utils').jsHtmlPrettifier
## jsHtmlPrettifier(script[, options])
    * `script` `String` javascript code 
    * `options` `Object` 
* * *
## Ittf scanner Feature
#### var ittfScanner = require('@wizzi/utils').ittfScanner
* * *
## Ittf graph Feature
#### var ittfGraph = require('@wizzi/utils').ittfGraph
* * *
## Filesystem Feature
#### var fSystem = require('@wizzi/utils').fSystem
* * *
## Prettify Feature
#### var pretty = require('@wizzi/utils').pretty
* * *
## Lorem ipsum Feature
#### var lorem = require('@wizzi/utils').lorem
* * *
## Crypto Feature
#### var crypto = require('@wizzi/utils').crypto
* * *
## Helpers Feature
#### var helpers = require('@wizzi/utils').helpers


## Wizzi

One machinery, many productions.




<p><a href="https://stfnbssl.github.io/wizzi">Project page</a></p>

## Built With
    * [Nodejs](https://nodejs.org)
    
    * [Wizzi](https://github.com/stfnbssl/wizzi)
    

## License

<p>This project is licensed under the MIT License - see the <a href="license.txt">license.txt</a> for details.</p>

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