# jtomler

> Reading json, yml or toml files.

Latest version **1.0.1** (published 2021-05-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install jtomler
pnpm add jtomler
yarn add jtomler
bun add jtomler
```

## 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.1 |
| Published | 2021-05-23 |
| First published | 2020-01-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nuzhnov A.A. |
| Maintainers | samuray |

## Links

- npm: https://www.npmjs.com/package/jtomler
- Repository: https://github.com/samurayii/jtomler
- Homepage: https://github.com/samurayii/jtomler#readme
- Issues: https://github.com/samurayii/jtomler/issues
- npm.io page: https://npm.io/package/jtomler

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [@iarna/toml](https://npm.io/package/@iarna/toml.md) ^2.2.5

## Recent versions

- 1.0.1 (latest) — 2021-05-23
- 1.0.0 — 2021-05-23
- 0.3.6 — 2020-11-30
- 0.3.5 — 2020-11-30
- 0.2.5 — 2020-11-11
- 0.1.5 — 2020-09-10
- 0.0.5 — 2020-06-29
- 0.0.4 — 2020-06-29
- 0.0.3 — 2020-01-29
- 0.0.2 — 2020-01-28
- 0.0.1 — 2020-01-28

## README

# Jtomler

Reading json or toml files.

## Example

```js
const jtomler = require('jtomler');

const file_body = `message: "hello yml"
array:
    - "array_key1"
    - "array_key1"
    - "\\\${YML_KEY_TEST}"
object: 
    val1: "val1-key"
    val2: "val2-key"
    test: "\${YML_KEY_TEST}"`

const yml_config = jtomler.parse(file_body);
const json_config = jtomler.parseFileSync('config.json');
const toml_config = await jtomler.parseFile('config.toml');
```

### jtomler.parse(content: string, env_flag: boolean = true) → Object

Parsing object from string.

params:

- **content** - Content for parsing
- **env_flag** - Flag for parsing environment keys.

### jtomler.parseFileSync(file_path: string, env_flag: boolean = true) → Object

Parsing object from file.

params:

- **file_path** - Path to file.
- **env_flag** - Flag for parsing environment keys.

### jtomler.parseFile(file_path: string, env_flag: boolean = true) → Promise<object\>

Parsing object from file.

params:

- **file_path** - Path to file.
- **env_flag** - Flag for parsing environment keys.

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