Util helpers for support builds.
npm install @mdi/util@mdi/util package relies on the @mdi/svg package. Any version of @mdi/svg can be used.
npm install @mdi/svg @mdi/util
`
- getVersion()
- getMeta([bool withPaths])
- write(file, data)
- read(file)
- exists(file)
$3
This returns the version of @mdi/svg referenced in the package.json.
returns semver string major.minor.build
$3
The main use of this library is to get all the icon data from the meta.json. Since the meta.json does not contain the SVG path data this method optionally allows this to be added to the object.
Please reference meta.json for more information.
returns icon array []
$3
`
import { write } from '@mdi/util'
write('file.txt', 'Hello World!')
`
$3
`
import { read } from '@mdi/util'
const foo = read('file.txt')
`
returns string of file contents
$3
`
import { exists } from '@mdi/util'
if (exits('file.txt')) {
// file exists!
}
`
returns bool true/false` if file exists