Skip to content

Instantly share code, notes, and snippets.

View eshimischi's full-sized avatar
🏠
Working from home

eshimischi

🏠
Working from home
View GitHub Profile
@eshimischi
eshimischi / esm-package.md
Created August 2, 2021 22:17 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@eshimischi
eshimischi / mutationObserver.js
Created September 21, 2021 20:15 — forked from Krelix/mutationObserver.js
Simple MutationObserver to understand the behaviour of DOM modifications for a specific AJAX library.
// Just a method to log NodeList content
var logChildrenModifications = function(type, array) {
if (array instanceof NodeList) {
for (var i = 0; i < array.length; i++) {
if (array.item(i) instanceof NodeList) {
logChildrenModifications(type, array.item(i));
} else {
console.log(type + ' ' + array.item(i).nodeName);
}
}

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.