ASafaeirad – Telegram
ASafaeirad
439 subscribers
190 photos
13 videos
2 files
265 links
My personal works, which I hope you like. contact @S_Kill
Download Telegram
TIL
There's a Node.JS util to strip ANSI escape codes

import { stripVTControlCharacters } from 'node:util';

const text = '\u001B[4mUnderlined\u001B[0m';
console.log(stripVTControlCharacters(text)); // "Underlined"


#nodejs #til
👍1
TIL: Boolean coercion are different
Note: Unlike other type conversions like string coercion or number coercion,
boolean coercion does not attempt to convert objects to primitives by calling user methods.
—MDN: Boolean: Boolean coercion

Read more

#til #ecmanoscript
3👍1
How to use AbortController

Read the Article

#abort #js
👍4🔥1
Bases
We have a new core plugin in Obsidian that can act as a database

https://help.obsidian.md/bases

#obsidian #news
🔥8🎉3
👍5👎3🎉1
TIL:
You can listen for attribute changes on a DOM element using a MutationObserver.
In my case, I needed to inspect a DOM element during a transient state that changed too quickly to catch manually.
Using DOM breakpoints wasn't helpful since the element was updated too frequently.
The solution was to use a MutationObserver to trigger specifically when a certain attribute changed.


const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (
mutation.type === "attributes" &&
mutation.attributeName === "my-attribute") {
debugger;
}
});
});

observer.observe(element, { attributes: true });


#til
7👍3🔥1🤯1
4🔥1🎉1
Zoo.js
An overview of 127 JavaScript engines.

https://zoo.js.org/

#javanoscript #engine
5👍2🎉1