const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is an example of app that uses an ecrypted NeDB database. It prompts the | |
* user for a password, decrypts the database, displays any existing records, | |
* promtps the user for a new record to store, encrypts that record, then exits. | |
* The password must be given each time the app is started. | |
*/ | |
const crypto = require('crypto') | |
const inquirer = require('inquirer') | |
const scrypt = require('scryptsy') |