Skip to content

A NodeJS library for easy implementation and manipulation of key-value pairs in your app.

License

Notifications You must be signed in to change notification settings

kishannareshpal/pairsjs

Repository files navigation

PairsJS

npm version

A NodeJS library for easy implementation and/or manipulation of key-value pairs. Can be used, for example, for configuration files.‌

​🌶 Getting Started is super easy!

To install PairJS into your existing nodeJS app run this command:

$ npm install @kishannareshpal/pairsjs

Or by adding this line into the dependencies section of your package.json file

dependencies {
    // add this line
    "@kishannareshpal/pairsjs": "{version.number}" // for the version, see top of this page.
}

// and then run this command.
$ npm install

🐌 Start using it right away!

// import the module
import PairsJS from '@kishannareshpal/pairsjs'

/* 1st: Initialize it. */
// – this will create a new file called `pairs.json`
// in your root directory.
let pairs = new PairsJS();


/* 2nd: CRUD */
// a) Add a new pair:
pairs.add("username", "joebytes")
pairs.add("age", 12)
pairs.add("isVerified", true)

/*
    ./pairs.json contents:
    
    {
        "username": "joebytes",
        "age": 12,
        "isVerified": true
    }
*/



// b) Get a pair