Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

jtomler

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jtomler

Reading json, yml or toml files.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Jtomler

Reading json or toml files.

Example

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.

FAQs

Package last updated on 23 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts