Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    materialize

    1.0.0¬†‚Äʬ†Public¬†‚Äʬ†Published

    Build Status

    Tiny utility to turn a list into an object

    Example:

    var materialize = require('materialize');
     
    var props = [
      { name: 'foo', value: 23 },
      { name: 'bar', value: 42 }
    ];
     
    console.log(materialize(props));

    Output:

    { foo: 32, bar: 42 }
     

    By default materialize() looks for a name and a value property. You may specify different names like this:

    var props = [
      { property: 'foo', val: 23 },
      { property: 'bar', val: 42 }
    ];
     
    var obj = materialize(props, 'property', 'val');

    License

    MIT

    Install

    npm i materialize

    DownloadsWeekly Downloads

    1,251

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar