defaults
npmv3.0.0TypeScriptEasily handle defaults for your options
Overview
defaults is an npm package that easily handle defaults for your options. It is extremely widely used, with about 47.6M downloads per week and 1 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need easily handle defaults for your options and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (47.6M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (3 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of defaults.
Dependencies
Dev (3)
Used by
Popular packages that depend on defaults.
Alternatives to defaults
Merge objects using their property descriptors
Really Fast Deep Clone
Define a lazily evaluated property on an object
A library for deep (recursive) merging of Javascript objects
An object schema merger/validator
ES Object-related atoms: Object, ToObject, RequireObjectCoercible
`Object.defineProperty`, but not IE 8's broken one.
option parsing and help generation
Find and load configuration from a package.json property, rc file, TypeScript module, and more!
A small polyfill for Object.setprototypeof
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
Get paths for storing things like data, config, cache, etc
Version history
| Version | Published | License |
|---|---|---|
| 3.0.0latest | 2 years ago | MIT |
| 2.0.2 | 2 years ago | MIT |
| 2.0.1 | 3 years ago | MIT |
| 2.0.0 | 3 years ago | MIT |
| 1.0.4 | 3 years ago | MIT |
| 1.0.3 | 10 years ago | MIT |
| 1.0.2 | 11 years ago | MIT |
| 1.0.1 | 11 years ago | MIT |
| 1.0.0 | 13 years ago | MIT |
Maintainers
Funding
Frequently asked questions
How do I install defaults?
Run `npm install defaults` to add defaults to your npm project.
What license is defaults released under?
defaults is distributed under the MIT license.
How popular is defaults?
defaults has approximately 47,573,389 downloads per week and 1 known dependent packages.