0.0.1 • Published 6 years ago

with-defaults v0.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

with-defaults

Usage

const withDefaults = require('with-defaults')

const serverDefaults = withDefaults({
  host: 'localhost',
  port: 5001
})

const serverOpts = {
  host: 'host.com'
}

serverDefaults(serverOpts) // { host: 'host.com', port: 5001 }

// or inside of a function

const createServer = opts => {
  const config = serverDefaults(opts) 
}