Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tush-tr/jsonmapper
A nodejs library which allows you to fill a object values to your target object
https://github.com/tush-tr/jsonmapper
javascript nodejs npm npm-module npm-package reactjs
Last synced: about 1 month ago
JSON representation
A nodejs library which allows you to fill a object values to your target object
- Host: GitHub
- URL: https://github.com/tush-tr/jsonmapper
- Owner: tush-tr
- License: mit
- Created: 2022-03-03T19:42:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T20:38:06.000Z (over 2 years ago)
- Last Synced: 2024-10-02T16:20:45.560Z (about 2 months ago)
- Topics: javascript, nodejs, npm, npm-module, npm-package, reactjs
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@tush-tr/jsonmapper
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```sh
npm install @tush-tr/jsonMapper
```## Import the package
```js
const {objectFill,jsonFill} = require('@tush-tr/jsonmapper')
```## Functions
### objectFill
```js
const desiredObj = objectFill(target, source)
```#### Example:
```js
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
```js
let assignJson = jsonFill(targetFilePath, sourceFilePath, outputJsonFilePath)
```#### Example:
```js
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](https://twitter.com/tush_tr604)
## License
[MIT license](LICENSE) © Tushar Rajpoot