Need Package Maintenance
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    namlpublic


    • Simple, unified API.
    • Freely convert between:

      • JSON (JavaScript Object Notation): .json
      • HJSON (Human JSON): .hjson
      • JSON5 (ES5 JSON): .json5
      • CSON (CoffeeScript Object Notation): .cson
      • YAML (Yet Another Markup Language): .yaml
      • TOML (Tom's Obvious, Minimal Language): .toml
      • INI (Initialization File Format): .ini

    Installation

    npm install naml

    CLI

    naml [input-file] [output-file]

    Example: naml path/to/input.yaml path/to/output.json

    API

    const NAML = require('naml')

    NAML.parse(string, type)

    • string {String}: the String to be parsed
    • type {String}: the input type; one of the following: json, hjson, json5, cson, yaml, toml, ini (may be prefixed with a .)
    • returns {Object}: the resulting Object
    • throws {Error}: if parsing failed

    NAML.stringify(object, type)

    • object {Object}: the Object to be stringified
    • type {String}: the input type; one of the following: json, hjson, json5, cson, yaml, toml, ini (may be prefixed with a .)
    • returns {String}: the resulting String
    • throws {Error}: if stringifying failed

    License

    WTFPL – Do What the F*ck You Want to Public License.

    Made with ❤️ by @MarkTiedemann.

    install

    npm i naml

    Downloadslast 7 days

    18

    version

    2.0.0

    license

    WTFPL

    repository

    github.com

    last publish

    collaborators

    • avatar