Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dlv

> 编程语言
Open source

Safe deep property access in 120 bytes. x = dlv(obj, 'a.b.x')

1.3K stars0 likes2 views
WebsiteGitHub

About

Safe deep property access in 120 bytes. x = dlv(obj, 'a.b.x')

dlv(obj, keypath)

Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined

Why?

Smallest possible implementation: only 120 bytes.

You could write this yourself, but then you'd have to write tests.

Supports ES Modules, CommonJS and globals.

Installation

npm install --save dlv

Usage

delve(object, keypath, [default])

…

Setter Counterparts

  • dset by @lukeed is the spiritual "set" counterpart of dlv and very fast.
  • bury by @kalmbach does the opposite of dlv and is implemented in a very similar manner.

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptdlvjavascriptkeyobject

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言