automapper-js
v1.0.15
Published
AutoMapper-js is released under the [MIT license]() & supports modern environments.<br>
Downloads
353
Maintainers
Readme
AUTOMAPPER-JS
AutoMapper-js is released under the MIT license & supports modern environments.
Installation
Using npm:
$ npm i --save automapper-js
In Node.js:
var mapper = require('automapper-js');
Why AutoMapper-js?
AutoMapper makes JavaScript easier by taking the hassle out of working with object mapping manually.
Usage
first define your model. e.g
class Person{
constructor(){
this.FirstName = "",
this.LastName = "",
this.Age = "",
this.Address = ""
}
}
module.exports = Person;
const mapper = require('automapper-js');
const PersonModel = require('./Models/Person');
const axios = require('axios');
async run()=>{
let persons = await axios.get("https://some-api/persons");
let newMappedObject = mapper(PersonModel, persons);
}
run();
made with love