proposal-top-level-await
proposal-regexp-match-indices
proposal-top-level-await | proposal-regexp-match-indices | |
---|---|---|
13 | 4 | |
1,005 | 58 | |
- | - | |
7.0 | 1.0 | |
over 3 years ago | over 2 years ago | |
HTML | HTML | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-top-level-await
-
Unveiling Breakthroughs Found In The State Of JS 2022 Survey
For more info about this feature, you can refer to the official proposal repo.
-
Write program in assembly, decompile to TypeScript, convert to JavaScript, run in Node
This one is Stage 4 (complete)
-
Open Source Adventures: Episode 29: Using D3 with old school tooling to visualize Russian Tank Losses
But browsers don't support top-level await yet. So we need to put it all inside as async function.
-
Configuring CommonJS & ES Modules for Node.js
Note that ESM is not “backwards” compatible with CJS: a CJS module cannot require() an ES Module; it is possible to use a dynamic import (await import()), but this is likely not what consumers expect (and, unlike ESM, CJS does not support Top-Level Await).
-
ES2022 Preview: 10 Exciting JavaScript Language Features From 2021
top-level await feature for ES modules
-
How to save fetch JSON result to global variable?
That said, ES2022 does introduce a top-level await that works in the top level scope, but only in modules, not global scope. So if in a module this could work:
-
Node v14.8+: Top Level Async Await
With the latest node version(s) (v14.8+), we should be able to rewrite the above code to something like this. proposal-top-level-await
-
What is a practical example of using a Promise? These Youtube tutorials are bogus
Now a days, you'll likely mostly use async/await. The few cases where you'll need the Promise API (then()'s etc.) is when you're outside of an async function. With the new top-level await feature coming to modules, you wouldn't even need it outside of async functions in module code which will make its usage even less common.
-
Basic import question
The await is in top level. The top level await proposal is in stage 3. Currently, the browser support is also not good enough but should work in latest version of the google chrome browser.
-
Rust's async isn't f#@king colored!
There is a proposal for top-level await in JS. I'm guessing this would effectively kinda do the same thing? Or am I wrong there?
proposal-regexp-match-indices
-
Unveiling Breakthroughs Found In The State Of JS 2022 Survey
For more info about this feature, you can refer to the official proposal repo.
-
How JavaScript works: regular expressions (RegExp)
It should be mentioned that this feature isn't part of the ECMAScript specification yet. It's currently a stage 3 proposal and will likely be part of ES2021 or ES2022.
- Node.js 16 Available Now
-
ES 2021 features (all 5 of them)
RegExp Match Indices (?)
What are some alternatives?
esbuild - An extremely fast bundler for the web
iswasmfast - Performance comparison of WebAssembly, C++ Addon, and native implementations of various algorithms in Node.js.
Rollup - Next-generation ES module bundler
public-roadmap - Checkly public roadmap. All planned features, updates and tweaks.
rust-async-bench - The cost of Rust async/await
proposal-relative-indexing-method - A TC39 proposal to add an .at() method to all the basic indexable classes (Array, String, TypedArray)
regexp-match-indices - Polyfill for the RegExp Match Indices proposal
proposal-nullish-coalescing - Nullish coalescing proposal x ?? y
nodejs-module-config-examples - A collection of Node.js module configurations for interoperability between CJS and ESM
proposal-weakrefs - WeakRefs
modules - Node.js Modules Team
proposals - Tracking ECMAScript Proposals