index.md - v1.1.0 / Exports
• default: Object
Name | Type |
---|---|
loadToml |
(path : string | URL | Buffer ) => Promise <unknown | null > |
loadTomlSync |
(path : string | URL | Buffer ) => unknown | null |
parseToml |
(data : string ) => JsonMap | null |
stringifyToml |
(data : JsonMap ) => string | null |
▸ loadToml(path
): Promise
<unknown
| null
>
load .toml
Example
import { loadToml } from 'load-toml'
const data = await loadToml('/path/of/toml') // \{ "name": "saqqdy" \}
Name | Type | Description |
---|---|---|
path |
string | URL | Buffer |
file path |
Promise
<unknown
| null
>
- result
▸ loadTomlSync(path
): unknown
| null
load .toml sync
Example
import { loadTomlSync } from 'load-toml'
const data = loadTomlSync('/path/of/toml') // \{ "name": "saqqdy" \}
Name | Type | Description |
---|---|---|
path |
string | URL | Buffer |
file path |
unknown
| null
- result
▸ parseToml(data
): JsonMap
| null
parse toml data
Name | Type | Description |
---|---|---|
data |
string |
file path |
JsonMap
| null
- result
▸ stringifyToml(data
): string
| null
stringify toml data
Name | Type | Description |
---|---|---|
data |
JsonMap |
file path |
string
| null
- result