
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@burnsred/defaults
Advanced tools
> **⚠️ DEPRECATED**: This package is deprecated and will no longer receive updates.
⚠️ DEPRECATED: This package is deprecated and will no longer receive updates.
This package has been deprecated as of version 1.0.0 and is no longer maintained.
What this means:
Recommended Action: Please migrate to alternative solutions as soon as possible.
For questions about this deprecation, please open an issue in the main repository.
Last maintained version: 1.0.0 Deprecation date: February 2026
A system for providing project-wide defaults to libraries.
First, define your defaults object.
This will map lookup keys to any sort of value. It can be nested to help with specialised scoping.
export default {
foo: FooComponent,
routes: {
foo: RoutedFoo,
members: {
foo: SpecialFooComponent,
},
},
}
In your code, use the hooks to access them:
const foo = useDefault("foo"); // Will return `FooComponent`
The lookup key can contain dots, in which case it will drill down into objects.
const foo = useDefault("routes.foo"); // Will return `RoutedFoo`
Will find the first matching (non-undefined) lookup for each key from its list of lookups.
const foo = useDefaultMap({
foo: ["routes.members.foo", "routes.foo"],
})
This will first check for default["routes"]["members"]["foo"], and if that's
undefined, try default["routes"]["foo"], finally resorting to
default["foo"].
Use the fallback defaults method to fill absent entries on an object.
const fullProps = useFillDefaults(props, defaultsMap);
Any keys from defaultsMap that are not present in props will be resolved as
with useDefaultMap.
All of the above hooks acception an optional scope argument.
This can be useful to, for instance, provide a typed default proxy for lookups within a certain section of the defaults object:
function useDefaultWidget(key: string): Widget {
return useDefault(key, 'widgets') as Widget;
}
FAQs
> **⚠️ DEPRECATED**: This package is deprecated and will no longer receive updates.
We found that @burnsred/defaults demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.