with-defaults

0.0.1 • Public • Published

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) 
}

Readme

Keywords

none

Package Sidebar

Install

npm i with-defaults

Weekly Downloads

4

Version

0.0.1

License

MIT

Unpacked Size

1.73 kB

Total Files

4

Last publish

Collaborators

  • beardedtim