Narcoleptic Programmers' Medicine

    js-dot
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    Welcome to js-dot 👋

    Version Documentation Maintenance License: MIT Twitter: elcharitas

    JavaScript dot notation handler

    🏠 Homepage

    Install

    $ npm i -D js-dot

    Usage

    const jsDot = require('jsdot')
    
    const data = {
      foo: {
        "bar": {
          "sample": "jsDot"
        }
      }
    }
    
    // ======== Get Data ========
    jsDot.get(data, "foo.bar.sample") // outputs "jsDot"
    // ---- or -----
    data.dot("foo.bar.sample") // outputs "jsDot"
    
    // ======== Get Data with default ========
    jsDot.get(data, "foo.nofoo", "foo") // outputs "foo"
    
    // ======== Set Data ========
    jsDot.set(data, "foo.bar", "bar")
    // ----- or ------
    data.dot("foo.bar", "bar")
    console.log(data.foo.bar.sample) // undefined

    Author

    👤 Jonathan Irhodia

    🤝 Contributing

    Contributions, issues and feature requests are welcome!
    Feel free to check issues page. You can also take a look at the contributing guide.

    Show your support

    Give a ⭐️ if this project helped you!

    📝 License

    Copyright © 2020 Jonathan Irhodia.
    This project is MIT licensed.


    Install

    npm i js-dot

    DownloadsWeekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    14.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • elcharitas