Execa 7.1 has been released! Featuring shell-free scripts. Thanks @sindresorhus and Aaron Casanova!
medium.com/@ehmicky/shell-fr…
#nodejs #node #cli #terminal #shell #unix #coding #programming
A library for handling JS errors in a simple, stable, consistent way
✍ by @ehmicky
🗂 tagged #javascript #node
changelog.com/news/zDVn
`modern-errors`: Handle errors in a simple, stable, consistent way.
github.com/ehmicky/modern-er…
#javascript #js #nodejs #node #programming #coding #windows #macos #linux #typescript
I am migrating from Twitter to #MastodonSocial. Please feel free to follow me there! fosstodon.org/@ehmicky
I like their decentralized, open-source, non-profit approach. You should join too!
2
New major release of `handle-cli-error`: pretty CLI errors!
github.com/ehmicky/handle-cl…
#javascript #js #nodejs #node #typescript #windows #macos #linux #programming #coding
How big is a JavaScript string?
blog.bitsrc.io/how-big-is-a-…
#javascript #js #nodejs #node #programming #coding #windows #macos #linux #typescript #unicode #i18n
@eduardoboucas @vbrown608 @erezrokah @JGAntunes I managed to insert 34 🦥 in that blog post. The sloth mania lives on!
1
3
Convert errors to/from plain objects.
github.com/ehmicky/error-ser…
#javascript #js #nodejs #node #typescript #programming #coding #windows #linux #macos #json
Check if a JavaScript value is valid JSON:
github.com/ehmicky/is-json-v…
#javascript #js #nodejs #node #typescript #programming #windows #linux #macos #json
One line in your `.bashrc` (or `.zshrc`, etc.) to use source maps in any Node.js error's stack trace on your local machine:
export NODE_OPTIONS="$NODE_OPTIONS --enable-source-maps"
#nodejs #node #programming #js #javascript
More information at nodejs.org/api/cli.html#--en…
Source maps allow showing the original file/line in errors' stack traces instead of the built file/line when using a build step (TypeScript, Babel, etc.).
This comes with a performance cost at load time, so is better used in dev only.
1
1
Big thanks to @BenjaminCoe for adding built-in support for source maps in Node.js 12.12.0 back in 2019! 🙏
github.com/nodejs/node/pull/…
2
⛑️ JSON serialization should never fail.
github.com/ehmicky/safe-json…
#nodejs #js #javascript #windows #linux #macos #programming
5
What happens when your error handling logic throws? This can occur when the thrown exception is weird: string, missing properties, etc.
The can be fixed by normalizing exceptions:
github.com/ehmicky/normalize…
#nodejs #js #javascript #windows #linux #macos #programming
`error.cause` is a cool recent JavaScript feature to wrap errors. Unfortunately, it is not available in Node 14, so here's a polyfill for it.
github.com/ehmicky/error-cau…
#nodejs #js #javascript #windows #linux #macos #programming
Merge objects/arrays declaratively.
github.com/ehmicky/declarati…
#nodejs #node #javascript #js #typescript #programming #linux #macos #windows
Library “Wild Wild Path”: accessing properties via key paths @ehmicky
github.com/ehmicky/wild-wild… ^ar
JavaScript library to set array items declaratively.
github.com/ehmicky/set-array
#javascript #js #nodejs #node #programming #linux #macos #windows
Wild Wild Path: Object Property Paths with Wildcards and Regexps - github.com/ehmicky/wild-wild…





