@tush-tr/jsonmapper

1.0.1 • Public • Published

tush_tr604

JsonMapper

A nodejs library which allows you to assign a json file values with another json file and create a new desired json file.

Installing the package

npm install @tush-tr/jsonMapper

Import the package

const {objectFill,jsonFill} = require('@tush-tr/jsonmapper')

Functions

objectFill

const desiredObj = objectFill(target, source)

Example:

const {objectFill,jsonFill} = require('@tush-tr/jsonmapper')
const targetObj = {
    name: "Rahul",
    class: 12
}

const sourceObj = {
    class: 10,
    role: "Monitor",
    name: "Tushar"
}
const assignedObj = objectFill(targetObj,sourceObj)
console.log(assignedObj)
// { name: 'Tushar', class: 10 }

jsonFill

let assignJson = jsonFill(targetFilePath, sourceFilePath, outputJsonFilePath)

Example:

const fillJson = jsonFill('target.json','source.json','output.json')
console.log(fillJson)
// done...

Contributing 🍻

I welcome pull requests, bug fixes and issue reports. Before proposing a change, please discuss your change by raising an issue.

Maintainer 😎

Tushar Rajpoot

License

MIT license © Tushar Rajpoot

Readme

Keywords

none

Package Sidebar

Install

npm i @tush-tr/jsonmapper

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.1 kB

Total Files

9

Last publish

Collaborators

  • tush-tr