JSPM

default-args

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q28902F
  • License MIT

A simple function for providing defaults to an options argument. No dependencies, tiny amount of code.

Package Exports

  • default-args
  • default-args/dist/default-args.cjs.js
  • default-args/dist/default-args.esm.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (default-args) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

default-args

Version CodeFactor Snyk Vulnerabilities for GitHub Repo bundlephobia

Downloads Node LICENSE

A simple function for providing defaults to an options to argument. No dependencies, tiny amount of code.

Usage

import defaults from 'default-args';

function helloWorld(options) {
    options = defaults({
        foo: true,
        bar: {
            a: 1,
            b: 2,
        },
    }, options);

    // do something with options
}

Installation

NPM

npm install default-args

Yarn

yarn add default-args

CDN

<script type="text/javascript" src="https://unpkg.com/default-args/"></script>

Packages

File Module Type Transpiled Source Maps
dist/default-args.esm.mjs esm No No
dist/default-args.cjs.js cjs Yes Yes
dist/default-args.esm.js esm Yes Yes
dist/default-args.js umd Yes Yes

License

The code is available under the MIT license.

Contributing

We are open to contributions, see CONTRIBUTING.md for more info.