- https://github.com/mhassan1/yarn-plugin-after-install
- https://github.com/voodooattack/yarn-plugin-workspaces-watch
- https://github.com/mhassan1/yarn-plugin-plugin-manager
- https://github.com/TheKnarf/yarn-plugin-envinfo
- https://github.com/zwade/yarn-plugin-script-daemon
- https://github.com/RuBAN-GT/yarn-plugin-enhanced-workspaces
- https://github.com/dradetsky/yarn-plugin-xinit
- https://github.com/zemd/yarn-plugin-wait
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// when T is any|unknown, Y is returned, otherwise N | |
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
// when T is never, Y is returned, otherwise N | |
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
// when T is a tuple, Y is returned, otherwise N | |
// valid tuples = [string], [string, boolean], | |
// invalid tuples = [], string[], (string | number)[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
let count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.is-following') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-unused-vars */ | |
/* eslint-disable no-else-return */ | |
// JSX constructor, similar to createElement() | |
export const h = (type, props, ...children) => { | |
return { | |
type, | |
// Props will be an object for components and DOM nodes, but a string for | |
// text nodes | |
props, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key}) | |
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=> | |
// arrays | |
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])): | |
// components | |
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=> | |
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):( | |
// create notes | |
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)), | |
// diff props |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s; | |
function supportsModuleWorkers() { | |
if (s==null) { | |
s = false; | |
try { | |
new Worker('data:,', Object.defineProperty({}, 'type', { | |
get() { s = true; } | |
})).terminate(); | |
} catch (e) {} | |
} |
Dynamic import, but where the module you import runs in a different thread.
Powered by Comlink and Module Workers.
Available via unpkg: https://unpkg.com/comlinkage
If you are listening to changes on an Event (DOM Events) to execute any side effects like performing network requests, you'd probably want to "debounce" your attached function executions.
This is an alternative to lodash.debounce
but "vanilla js" packed as
a Vue SFC to import
it as a
mixin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class asyncAwaiterQueue { | |
constructor(...values) { | |
this.promise = new Promise(resolve => { | |
this.resolve = resolve; | |
}); | |
values.forEach(v => this.put(v)); | |
} |
NewerOlder