Skip to content

Instantly share code, notes, and snippets.

@katapad
Created February 22, 2013 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katapad/5013364 to your computer and use it in GitHub Desktop.
Save katapad/5013364 to your computer and use it in GitHub Desktop.
jsonをマージするやつ
fs = require 'fs'
_ = require 'underscore'
$ = require 'jquery'
_mergeConfig = (base, merge)->
base = _.clone(base)
result = $.extend(true, {}, base, merge);
return result
module.exports.create = (outPath, base, merge)->
json = _mergeConfig(base, merge)
fs.writeFileSync(outPath, JSON.stringify(json));
return json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment