Skip to content

Instantly share code, notes, and snippets.

{
"cars": {
"car-key-1": {
"model": "Opel Astra"
},
"car-key-2": {
"model": "BMW 3"
}
},
"car-usage": {
@BraunreutherA
BraunreutherA / custom_fields.js
Created December 6, 2016 01:12
Keystone.js custom fields
/**
* This little script copies the custom fields into the node modules directly into the keystone types.
* Afterwards it hooks into the keystone field types and registers the new model.
*
* ATTENTION if a model already exists it'll overwrite it.
* This way you can copy the fields and update them to your liking.
*/
var _ = require('lodash');
var shell = require('shelljs');