0.0.6 • Published 7 years ago

the-magus v0.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

The Magus

MECEなjsonオブジェクトを生成できるmoduleです。

1.組み合わせを準備

const area = [ '渋谷', '新宿' ];
const timeZone = [ '夜' ];
const leisure = [ 'カラオケ', 'ボーリング', 'ダーツ' ];
const combinations = { area, timeZone, leisure };

2.書き換えたいオブジェクトを準備

const templateData = {
  text: '今日の$timeZoneは、$areaのあたりへ、$leisureしに行こう!'
};

3.実行

const magus = new Magus(combinations, templateData);

magus.produce((product) => {
  console.info(product);
});

/**
* CONSOLE

{ text: '今日の夜は、渋谷のあたりへ、カラオケしに行こう!' }
{ text: '今日の夜は、新宿のあたりへ、ボーリングしに行こう!' }
{ text: '今日の夜は、渋谷のあたりへ、ダーツしに行こう!' }
{ text: '今日の夜は、新宿のあたりへ、カラオケしに行こう!' }
{ text: '今日の夜は、渋谷のあたりへ、ボーリングしに行こう!' }
{ text: '今日の夜は、新宿のあたりへ、ダーツしに行こう!' }

*/
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago