Object Key Mirror
Object key mirror is a zero-dependency Node.js module that lets you easily create objects with values equal to their key names.
If you're one to define constants for your action types when managing state in complex applications, you'll totally love object key mirror! In fact, it's Inspired by Facebook's keyMirror.
Installation
npm install object-key-mirror --save
Usage
; const actionTypes = ; // output LOGIN_SUCCESS: 'LOGIN_SUCCESS' SIGNUP_SUCCESS: 'SIGNUP_SUCCESS' LOGIN_FAILURE: 'LOGIN_FAILURE' const names = ; // output "john smith": 'john smith' doe: 'doe' philip: 'philip' smith: 'smith'