pm

property-maper

Module in JavaScript for map object's properties to string key's properties as values

Showing:

Popularity

Downloads/wk

8

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

PropertyMaper Build Status Coverage Status

Module in JavaScript for map object's properties to string key's properties as values

##Prerequisites To Install and run the project you need to have installed NodeJS.

https://nodejs.org/en

##Installation

npm install property-maper

##Usage To map an object to a json-string template:

.map(map, scope)

Parameter: map(string) Contains the string template in json format

Parameter: scope(object) Contains the object wich has the data to bind into map

Return: Maped object with map format

##Example

var pm = require('property-maper');

var result = pm.map("{
    name:data.person.name,
    last_name:data.person.last_name,
    addres:data.person.addres,
    hobbies:data.person.hobbies,
    others:data.others.other
  }",
  {
    data: {
      person: {
        name:"Carlos",
        last_name:"Linares",
        addres:"Guadalajara",
        hobbies:"Play Guitar, Video Games"
      },
      others: {
        other: "Other things, etc."
      }
    }
  }
);

console.log(result);

##Result The result will be...

{
  name:"Carlos",
  last_name:"Linares",
  addres:"Guadalajara",
  hobbies:"Play Guitar, Video Games",
  others:"Other things, etc."
}

##License MIT License

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100